Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
[Loading ML file ring_plugin.cmxs (using legacy method) ... done]
[Loading ML file zify_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_plugin.cmxs (using legacy method) ... done]
[Loading ML file btauto_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssrmatching_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssreflect_plugin.cmxs (using legacy method) ... done]
From Generated Require Import DisjointSetUnion.From stdpp Require Import numbers list.Require Import Coq.Logic.FunctionalExtensionality.Require Import Wellfounded.Definitionstate : BlockchainState := funaddress =>
if decide (address = repeat (0%Z) 20) then
BlockchainContract arrayIndex0 _ (arrayType _ environment0) (arrays _ environment0) 100000%Z (funcdef_0__main (funx => false) (funx => 0%Z) (funx => repeat0%Z 20))
else ExternallyOwned 0%Z.DefinitionstateAfterInteractionsarraysmoney : BlockchainState := funaddress =>
if decide (address = repeat (0%Z) 20) then
BlockchainContract arrayIndex0 _ (arrayType _ environment0) arrays (100000%Z - money) (funcdef_0__main (funx => false) (funx => 0%Z) (funx => repeat0%Z 20))
elseif decide (address = repeat (1%Z) 20) then ExternallyOwned money else ExternallyOwned 0%Z.Fixpointinteract (state : BlockchainState) (interactions : list (Z * Z)) :=
match interactions with
| [] => getBalance (state (repeat1%Z 20))
| (a, b) :: tail =>
match invokeContract (repeat1%Z 20) (repeat0%Z 20) 0%Z state state [a; b] 1with
| Some (_, changedState) => interact changedState tail
| None => 0%Z
endend.DefinitionoptimalInteractions (x : list (Z * Z)) := forallx', Z.le (interact state x') (interact state x).InductiveSlot :=
| ReferTo (x : nat)
| Ancestor (x : Tree).DefinitionnoIllegalIndices (dsu : list Slot) := forallxy, nth x dsu (Ancestor Unit) = ReferTo y -> y < length dsu.FixpointconvertToArray (x : list Slot) : list Z :=
match x with
| [] => []
| (ReferTo x) :: tail => (Z.of_nat x) :: convertToArray tail
| (Ancestor x) :: tail => (Z.sub 256%Z (Z.of_nat (leafCount x))) :: convertToArray tail
end.
x: list Slot n: nat hN: n < length x
nth n (convertToArray x) 0%Z =
match nth n x (Ancestor Unit) with
| ReferTo _0 => Z.of_nat _0
| Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z
end
x: list Slot n: nat hN: n < length x
nth n (convertToArray x) 0%Z =
match nth n x (Ancestor Unit) with
| ReferTo _0 => Z.of_nat _0
| Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z
end
x: list Slot
∀_0 : nat,
_0 < length x
→ nth _0 (convertToArray x) 0%Z =
match nth _0 x (Ancestor Unit) with
| ReferTo _1 => Z.of_nat _1
| Ancestor _1 => (256 - Z.of_nat (leafCount _1))%Z
end
n: nat hN: n < length []
nth n (convertToArray []) 0%Z =
match nth n [] (Ancestor Unit) with
| ReferTo _0 => Z.of_nat _0
| Ancestor _0 => (256 - Z.of_nat (leafCount _0))%Z
end
dsu: list Slot h: length dsu < 256 h1: noIllegalIndices dsu n, a, b: nat c: nth a dsu (Ancestor Unit) = ReferTo b
b < 256
dsu: list Slot h: length dsu < 256 h1: noIllegalIndices dsu n, a, b: nat c: nth a dsu (Ancestor Unit) = ReferTo b _0: b < length dsu
b < 256
lia.Qed.DefinitiondsuScore (dsu : list Slot) := Z.of_nat (list_sum (map (funx => match x with | ReferTo _ => 0 | Ancestor x => score x end) dsu)).DefinitiondsuLeafCount (dsu : list Slot) := Z.of_nat (list_sum (map (funx => match x with | ReferTo _ => 0 | Ancestor x => leafCount x end) dsu)).
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v step: dsu =
take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v step: dsu =
take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu
leafCount u + leafCount v
≤ Z.to_nat
(dsuLeafCount
(take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++
drop (b + 1) dsu))
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v step: dsu =
take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu
leafCount u + leafCount v
≤ Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
(take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++
drop (b + 1) dsu))))
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v step: dsu =
take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu
leafCount u + leafCount v
≤ list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take a dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor u]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S a) (take b dsu))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor v]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (b + 1) dsu)))))
dsu: list Slot a, b: nat hAB: a < b hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v step: dsu =
take a dsu ++
[nth a dsu (Ancestor Unit)] ++
drop (S a) (take b dsu) ++
[nth b dsu (Ancestor Unit)] ++ drop (b + 1) dsu
leafCount u + leafCount v
≤ list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take a dsu)) +
(leafCount u + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S a) (take b dsu))) +
(leafCount v + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (b + 1) dsu)))))
lia.Qed.
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v hs: a < b
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v hs: b < a
leafCount v + leafCount u
≤ Z.to_nat (dsuLeafCount dsu)
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v hs: a < b
leafCount u + leafCount v
≤ Z.to_nat (dsuLeafCount dsu)
apply (sumTwoAncestors' _ a b); assumption.
dsu: list Slot a, b: nat hAB: a ≠ b hA: a < length dsu hB: b < length dsu u: Tree hA1: nth a dsu (Ancestor Unit) = Ancestor u v: Tree hB1: nth b dsu (Ancestor Unit) = Ancestor v hs: b < a
leafCount v + leafCount u
≤ Z.to_nat (dsuLeafCount dsu)
apply (sumTwoAncestors' _ b a); assumption.Qed.
dsu: list Slot h: length dsu < 256 h1: Z.to_nat (dsuLeafCount dsu) < 128 n: nat hn: n < length dsu x: Tree h2: nth n dsu (Ancestor Unit) = Ancestor x
leafCount x < 128
dsu: list Slot h: length dsu < 256 h1: Z.to_nat (dsuLeafCount dsu) < 128 n: nat hn: n < length dsu x: Tree h2: nth n dsu (Ancestor Unit) = Ancestor x
apply nthLowerBoundConvertAux; try (assumption || lia).Qed.Fixpointancestor (dsu : list Slot) (fuel : nat) (index : nat) :=
match fuel with
| O => index
| S fuel => match nth index dsu (Ancestor Unit) with
| ReferTo x => ancestor dsu fuel x
| Ancestor _ => index
endend.FixpointancestorChain (dsu : list Slot) (fuel : nat) (index : nat) :=
match fuel with
| O => [index]
| S fuel => match nth index dsu (Ancestor Unit) with
| ReferTo x => index :: ancestorChain dsu fuel x
| Ancestor _ => index :: nil
endend.
dsu: list Slot fuel, index: nat
nth 0 (ancestorChain dsu fuel index) 0 = index
dsu: list Slot fuel, index: nat
nth 0 (ancestorChain dsu fuel index) 0 = index
dsu: list Slot index: nat
nth 0 (ancestorChain dsu 0 index) 0 = index
dsu: list Slot fuel, index: nat
nth 0 (ancestorChain dsu (S fuel) index) 0 = index
dsu: list Slot index: nat
nth 0 (ancestorChain dsu 0 index) 0 = index
easy.
dsu: list Slot fuel, index: nat
nth 0 (ancestorChain dsu (S fuel) index) 0 = index
dsu: list Slot fuel, index: nat
nth 0match nth index dsu (Ancestor Unit) with
| ReferTo _0 => index :: ancestorChain dsu fuel _0
| Ancestor _ => [index]
end0 = index
destruct (nth index _ _); easy.Qed.
dsu: list Slot fuel, index: nat
0 < length (ancestorChain dsu fuel index)
dsu: list Slot fuel, index: nat
0 < length (ancestorChain dsu fuel index)
dsu: list Slot index: nat
0 < length (ancestorChain dsu 0 index)
dsu: list Slot fuel, index: nat
0 < length (ancestorChain dsu (S fuel) index)
dsu: list Slot index: nat
0 < length (ancestorChain dsu 0 index)
dsu: list Slot index: nat
0 < 1
lia.
dsu: list Slot fuel, index: nat
0 < length (ancestorChain dsu (S fuel) index)
dsu: list Slot fuel, index: nat
0 <
length
match nth index dsu (Ancestor Unit) with
| ReferTo _0 => index :: ancestorChain dsu fuel _0
| Ancestor _ => [index]
end
destruct (nth index _ _); cbv; lia.Qed.
dsu: list Slot fuel, index: nat
last (ancestorChain dsu fuel index) =
Some (ancestor dsu fuel index)
dsu: list Slot fuel, index: nat
last (ancestorChain dsu fuel index) =
Some (ancestor dsu fuel index)
dsu: list Slot index: nat
last (ancestorChain dsu 0 index) =
Some (ancestor dsu 0 index)
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0)
last (ancestorChain dsu (S fuel) index) =
Some (ancestor dsu (S fuel) index)
dsu: list Slot index: nat
last (ancestorChain dsu 0 index) =
Some (ancestor dsu 0 index)
easy.
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0)
last (ancestorChain dsu (S fuel) index) =
Some (ancestor dsu (S fuel) index)
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0)
lastmatch nth index dsu (Ancestor Unit) with
| ReferTo _0 => index :: ancestorChain dsu fuel _0
| Ancestor _ => [index]
end =
Some
match nth index dsu (Ancestor Unit) with
| ReferTo _0 => ancestor dsu fuel _0
| Ancestor _ => index
end
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: Slot hX: x = nth index dsu (Ancestor Unit)
lastmatch x with
| ReferTo _0 => index :: ancestorChain dsu fuel _0
| Ancestor _ => [index]
end =
Some
match x with
| ReferTo _0 => ancestor dsu fuel _0
| Ancestor _ => index
end
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: nat hX: nth index dsu (Ancestor Unit) = ReferTo x
last (index :: ancestorChain dsu fuel x) =
Some (ancestor dsu fuel x)
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: Tree hX: nth index dsu (Ancestor Unit) = Ancestor x
last [index] = Some index
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: nat hX: nth index dsu (Ancestor Unit) = ReferTo x
last (index :: ancestorChain dsu fuel x) =
Some (ancestor dsu fuel x)
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: nat hX: nth index dsu (Ancestor Unit) = ReferTo x
matchlast (ancestorChain dsu fuel x) with
| Some _0 => Some _0
| None => Some index
end = Some (ancestor dsu fuel x)
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: nat hX: nth index dsu (Ancestor Unit) = ReferTo x h: last (ancestorChain dsu fuel x) =
Some (ancestor dsu fuel x)
matchlast (ancestorChain dsu fuel x) with
| Some _0 => Some _0
| None => Some index
end = Some (ancestor dsu fuel x)
nowrewrite h.
dsu: list Slot fuel, index: nat IH: ∀_0 : nat,
last (ancestorChain dsu fuel _0) =
Some (ancestor dsu fuel _0) x: Tree hX: nth index dsu (Ancestor Unit) = Ancestor x
last [index] = Some index
easy.Qed.
A: Type l: list A d: A
default d (last l) = nth (length l - 1) l d
A: Type l: list A d: A
default d (last l) = nth (length l - 1) l d
A: Type d: A
default d (last []) = nth (length [] - 1) [] d
A: Type head: A tail: list A d: A IH: default d (last tail) =
nth (length tail - 1) tail d
default d (last (head :: tail)) =
nth (length (head :: tail) - 1) (head :: tail) d
A: Type d: A
default d (last []) = nth (length [] - 1) [] d
easy.
A: Type head: A tail: list A d: A IH: default d (last tail) =
nth (length tail - 1) tail d
default d (last (head :: tail)) =
nth (length (head :: tail) - 1) (head :: tail) d
A: Type head: A tail: list A d: A IH: default d (last tail) =
nth (length tail - 1) tail d
default d (last (head :: tail)) =
match length tail - 0with
| 0 => head
| S _0 => nth _0 tail d
end
A: Type head: A tail: list A d: A IH: default d (last tail) =
nth (length tail - 1) tail d
default d
matchlast tail with
| Some _0 => Some _0
| None => Some head
end =
match length tail - 0with
| 0 => head
| S _0 => nth _0 tail d
end
A: Type head: A tail: list A d: A IH: default d (last tail) =
nth (length tail - 1) tail d
default d
matchlast tail with
| Some _0 => Some _0
| None => Some head
end =
match length tail with
| 0 => head
| S _0 => nth _0 tail d
end
A: Type head, d: A IH: default d (last []) = nth (length [] - 1) [] d
default d
matchlast [] with
| Some _0 => Some _0
| None => Some head
end =
match length [] with
| 0 => head
| S _0 => nth _0 [] d
end
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length (head' :: tail') - 1)
(head' :: tail') d
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end =
match length (head' :: tail') with
| 0 => head
| S _0 => nth _0 (head' :: tail') d
end
A: Type head, d: A IH: default d (last []) = nth (length [] - 1) [] d
default d
matchlast [] with
| Some _0 => Some _0
| None => Some head
end =
match length [] with
| 0 => head
| S _0 => nth _0 [] d
end
easy.
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length (head' :: tail') - 1)
(head' :: tail') d
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end =
match length (head' :: tail') with
| 0 => head
| S _0 => nth _0 (head' :: tail') d
end
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (S (length tail') - 1) (head' :: tail') d
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end = nth (length tail') (head' :: tail') d
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end = nth (length tail') (head' :: tail') d
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end = default d (last (head' :: tail'))
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d
last (head' :: tail') ≠ None
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d h: last (head' :: tail') ≠ None
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end = default d (last (head' :: tail'))
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d
last (head' :: tail') ≠ None
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d
matchlast tail' with
| Some _0 => Some _0
| None => Some head'
end ≠ None
destruct (last tail'); easy.
A: Type head, head': A tail': list A d: A IH: default d (last (head' :: tail')) =
nth (length tail') (head' :: tail') d h: last (head' :: tail') ≠ None
default d
matchlast (head' :: tail') with
| Some _0 => Some _0
| None => Some head
end = default d (last (head' :: tail'))
A: Type head, head': A tail': list A d, x: A IH: default d (Some x) =
nth (length tail') (head' :: tail') d h: Some x ≠ None
default d (Some x) = default d (Some x)
A: Type head, head': A tail': list A d: A IH: default d None =
nth (length tail') (head' :: tail') d h: None ≠ None
default d (Some head) = default d None
A: Type head, head': A tail': list A d, x: A IH: default d (Some x) =
nth (length tail') (head' :: tail') d h: Some x ≠ None
default d (Some x) = default d (Some x)
reflexivity.
A: Type head, head': A tail': list A d: A IH: default d None =
nth (length tail') (head' :: tail') d h: None ≠ None
exact h.Qed.DefinitionvalidChain (dsu : list Slot) (chain : list nat) := chain <> [] /\ nth 0 chain 0 < length dsu /\ forallindex, S index < length chain -> nth (nth index chain 0) dsu (Ancestor Unit) = ReferTo (nth (S index) chain 0).DefinitionvalidChainToAncestor (dsu : list Slot) (chain : list nat) := validChain dsu chain /\ existsx, nth (nth (length chain - 1) chain 0) dsu (Ancestor Unit) = Ancestor x.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat hImage: ∀_0 : nat, f _0 < 0
∃_0_1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat hImage: ∀_0 : nat, f _0 < 0
∃_0_1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
f: nat → nat hImage: ∀_0 : nat, f _0 < 0 _0: f 0 < 0
∃_0_1 : nat, _0 ≠ _1 ∧ _0 < 1 ∧ _1 < 1 ∧ f _0 = f _1
lia.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 s: bool hs: s =
existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n)))
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 s: bool hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) = s
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true w: nat h1: w < S n h2: bool_decide (f w = f (S n)) = true
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true w: nat h1: w < S n h2: f w = f (S n)
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true w: nat h1: w < S n h2: f w = f (S n)
∃_0 : nat,
w ≠ _0 ∧ w < S (S n) ∧ _0 < S (S n) ∧ f w = f _0
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
true w: nat h1: w < S n h2: f w = f (S n)
w ≠ S n ∧ w < S (S n) ∧ S n < S (S n) ∧ f w = f (S n)
repeatsplit; trylia.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: notExistsInRangeLogic (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n)))
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n))
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n))
∀_0 : nat, _0 < S n → f _0 ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n)
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n))
∀_0 : nat, _0 < S n → f _0 ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n
f x ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ bool_decide (f x = f (S n))
f x ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ true h1: f x = f (S n)
f x ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ false h1: f x ≠ f (S n)
f x ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ true h1: f x = f (S n)
f x ≠ f (S n)
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ true h1: f x = f (S n)
False
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ true h1: f x = f (S n)
true
easy.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) x: nat h: x < S n h2: ¬ false h1: f x ≠ f (S n)
f x ≠ f (S n)
assumption.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n)
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n = 0
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n = 0
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n = 0 h2: f 0 < S n
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n = 0 h2: f 0 < S n h3: f 1 < S n
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n g: (if decide (f a < f (S n)) then f a else f a - 1) =
(if decide (f b < f (S n)) then f b else f b - 1)
∃_0_1 : nat,
_0 ≠ _1 ∧ _0 < S (S n) ∧ _1 < S (S n) ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n g: (if decide (f a < f (S n)) then f a else f a - 1) =
(if decide (f b < f (S n)) then f b else f b - 1)
a ≠ b ∧ a < S (S n) ∧ b < S (S n) ∧ f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n g: (if decide (f a < f (S n)) then f a else f a - 1) =
(if decide (f b < f (S n)) then f b else f b - 1)
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: f a < f (S n) h3: ¬ f b < f (S n) g: f a = f b - 1
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: f b < f (S n) g: f a - 1 = f b
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: ¬ f b < f (S n) g: f a - 1 = f b - 1
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: f a < f (S n) h3: ¬ f b < f (S n) g: f a = f b - 1
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: f a < f (S n) h3: ¬ f b < f (S n) g: f a = f b - 1 _0: f b ≠ f (S n)
f a = f b
lia.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: f b < f (S n) g: f a - 1 = f b
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: f b < f (S n) g: f a - 1 = f b _0: f a ≠ f (S n)
f a = f b
lia.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: ¬ f b < f (S n) g: f a - 1 = f b - 1
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: ¬ f b < f (S n) g: f a - 1 = f b - 1 _0: f b ≠ f (S n)
f a = f b
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < S n IH: ∀_0 : nat → nat,
(∀_1 : nat, _0 _1 < n)
→ ∃_1_2 : nat,
_1 ≠ _2
∧ _1 < S n ∧ _2 < S n ∧ _0 _1 = _0 _2 hs: existsInRange (S n)
(λ_0 : nat, bool_decide (f _0 = f (S n))) =
false step: ∀_0 : nat,
_0 < S n → ¬ bool_decide (f _0 = f (S n)) step2: ∀_0 : nat, _0 < S n → f _0 ≠ f (S n) h1: n ≠ 0 a, b: nat c: a ≠ b d: a < S n e: b < S n h2: ¬ f a < f (S n) h3: ¬ f b < f (S n) g: f a - 1 = f b - 1 _0: f b ≠ f (S n) _1: f a ≠ f (S n)
f a = f b
lia.Qed.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: a < b
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: b < a
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: a < b
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: a < b
a < b ∧ a < S n ∧ b < S n ∧ f a = f b
repeatsplit; assumption.
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: b < a
∃_0_1 : nat,
_0 < _1 ∧ _0 < S n ∧ _1 < S n ∧ f _0 = f _1
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f a = f b h: b < a
b < a ∧ b < S n ∧ a < S n ∧ f b = f a
f: nat → nat n: nat hImage: ∀_0 : nat, f _0 < n a, b: nat c: a ≠ b d: a < S n e: b < S n g: f b = f a h: b < a
b < a ∧ b < S n ∧ a < S n ∧ f b = f a
repeatsplit; assumption.Qed.
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + delta < length chain hJDelta: j + delta < length chain hEq: nth i chain 0 = nth j chain 0
nth (i + delta) chain 0 = nth (j + delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + delta < length chain hJDelta: j + delta < length chain hEq: nth i chain 0 = nth j chain 0
nth (i + delta) chain 0 = nth (j + delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j: nat hI: i < length chain hJ: j < length chain hIDelta: i + 0 < length chain hJDelta: j + 0 < length chain hEq: nth i chain 0 = nth j chain 0
nth (i + 0) chain 0 = nth (j + 0) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j: nat hI: i < length chain hJ: j < length chain hIDelta: i + 0 < length chain hJDelta: j + 0 < length chain hEq: nth i chain 0 = nth j chain 0
nth (i + 0) chain 0 = nth (j + 0) chain 0
nowrewrite !Nat.add_0_r.
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0 h: nth (i + delta) chain 0 = nth (j + delta) chain 0
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0 h: nth (i + delta) chain 0 = nth (j + delta) chain 0 a: chain ≠ [] b: nth 0 chain 0 < length dsu c: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0)
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0 h: nth (i + delta) chain 0 = nth (j + delta) chain 0 a: chain ≠ [] b: nth 0 chain 0 < length dsu c: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) c1: nth (nth (i + delta) chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S (i + delta)) chain 0)
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
dsu: list Slot chain: list nat h2: validChain dsu chain i, j, delta: nat hI: i < length chain hJ: j < length chain hIDelta: i + S delta < length chain hJDelta: j + S delta < length chain hEq: nth i chain 0 = nth j chain 0 IH: i + delta < length chain
→ j + delta < length chain
→ nth (i + delta) chain 0 =
nth (j + delta) chain 0 h: nth (i + delta) chain 0 = nth (j + delta) chain 0 a: chain ≠ [] b: nth 0 chain 0 < length dsu c: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) c1: nth (nth (i + delta) chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S (i + delta)) chain 0) c2: nth (nth (j + delta) chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S (j + delta)) chain 0)
nth (i + S delta) chain 0 = nth (j + S delta) chain 0
take 1 (head :: tail) = ancestorChain dsu 0 vertex
dsu: list Slot head: nat tail: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu (head :: tail) vertex: nat h3: head = vertex
head :: take 0 tail = [vertex]
dsu: list Slot head: nat tail: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu (head :: tail) vertex: nat h3: head = vertex
[vertex] = [vertex]
reflexivity.
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0]
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0)
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: length chain ≤ S fuel
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0)
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0)
ancestorChain dsu fuel vertex ++
[nth (S fuel) chain 0] =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0) h6: S fuel < length chain
ancestorChain dsu fuel vertex ++
[nth (S fuel) chain 0] =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0) h6: S fuel < length chain
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0) h6: S fuel < length chain h7: ∀_0 : nat,
S fuel + _0 < length chain
→ ancestorChain dsu fuel (nth _0 chain 0) ++
[nth (S fuel + _0) chain 0] =
ancestorChain dsu (S fuel) (nth _0 chain 0)
ancestorChain dsu fuel vertex ++
[nth (S fuel) chain 0] =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0) h6: S fuel < length chain
dsu: list Slot chain: list nat h1: noIllegalIndices dsu fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: chain !! S fuel = Some (nth (S fuel) chain 0) h6: S fuel < length chain
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: length chain ≤ S fuel
take (S (S fuel)) chain =
ancestorChain dsu (S fuel) vertex
dsu: list Slot chain: list nat h1: noIllegalIndices dsu h2: validChainToAncestor dsu chain fuel, vertex: nat h3: nth 0 chain 0 = vertex IH: take (S fuel) chain =
ancestorChain dsu fuel vertex h4: chain !! S fuel = Some (nth (S fuel) chain 0)
→ take (S (S fuel)) chain =
take (S fuel) chain ++ [nth (S fuel) chain 0] h5: length chain ≤ S fuel
dsu: list Slot u, v: nat hU: u < length dsu h: noIllegalIndices dsu h': withoutCyclesN dsu (length dsu) hR: nth u dsu (Ancestor Unit) = ReferTo v hV: v < length dsu
0 < length dsu
u, v: nat hU: u < length [] h: noIllegalIndices [] h': withoutCyclesN [] (length []) hR: nth u [] (Ancestor Unit) = ReferTo v hV: v < length []
0 < length []
head: Slot tail: list Slot u, v: nat hU: u < length (head :: tail) h: noIllegalIndices (head :: tail) h': withoutCyclesN (head :: tail)
(length (head :: tail)) hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v hV: v < length (head :: tail)
0 < length (head :: tail)
u, v: nat hU: u < length [] h: noIllegalIndices [] h': withoutCyclesN [] (length []) hR: nth u [] (Ancestor Unit) = ReferTo v hV: v < length []
0 < length []
u, v: nat hU: u < length [] h: noIllegalIndices [] h': withoutCyclesN [] (length []) hR: match u with
| 0 | _ => Ancestor Unit
end = ReferTo v hV: v < length []
0 < length []
easy.
head: Slot tail: list Slot u, v: nat hU: u < length (head :: tail) h: noIllegalIndices (head :: tail) h': withoutCyclesN (head :: tail)
(length (head :: tail)) hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v hV: v < length (head :: tail)
0 < length (head :: tail)
head: Slot tail: list Slot u, v: nat hU: u < length (head :: tail) h: noIllegalIndices (head :: tail) h': withoutCyclesN (head :: tail)
(length (head :: tail)) hR: nth u (head :: tail) (Ancestor Unit) = ReferTo v hV: v < length (head :: tail)
0 < S (length tail)
lia.
dsu: list Slot u, v: nat hU: u < length dsu h: noIllegalIndices dsu h': withoutCyclesN dsu (length dsu) hR: nth u dsu (Ancestor Unit) = ReferTo v hV: v < length dsu hL: 0 < length dsu
exact he.Qed.FixpointwithoutCyclesBool (dsu : list Slot) (n : nat) : bool :=
match n with
| O => true
| S n => match nth (ancestor dsu (length dsu) n) dsu (Ancestor Unit) with
| Ancestor _ => withoutCyclesBool dsu n
| _ => false
endend.
dsu: list Slot n: nat
withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
dsu: list Slot n: nat
withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
dsu: list Slot
withoutCyclesN dsu 0 ↔ withoutCyclesBool dsu 0
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
withoutCyclesN dsu (S n) ↔ withoutCyclesBool dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n
withoutCyclesN dsu (S n) ↔ withoutCyclesBool dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n)
withoutCyclesBool dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesBool dsu (S n)
withoutCyclesN dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n)
withoutCyclesBool dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n)
match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n) step: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n) _0: Tree step: true
withoutCyclesBool dsu n
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n) _0: Tree step: true
withoutCyclesN dsu n
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n) _0: Tree step: true x: nat y: x < n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesN dsu (S n) _0: Tree step: true x: nat y: x < n _1: match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
assumption.
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesBool dsu (S n)
withoutCyclesN dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: withoutCyclesBool dsu (S n)
withoutCyclesN dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end
withoutCyclesN dsu (S n)
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n h2: x = n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n h2: x < n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n h2: x = n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n h2: x = n
match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h3: Tree h: withoutCyclesBool dsu n x: nat y: x < S n h2: x = n
true
easy.
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n h: match
nth (ancestor dsu (length dsu) n) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => withoutCyclesBool dsu n
end x: nat y: x < S n h2: x < n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n _0: Tree h: withoutCyclesBool dsu n x: nat y: x < S n h2: x < n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n _0: Tree h: withoutCyclesN dsu n x: nat y: x < S n h2: x < n
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
dsu: list Slot n: nat IH: withoutCyclesN dsu n ↔ withoutCyclesBool dsu n _0: Tree h: withoutCyclesN dsu n x: nat y: x < S n h2: x < n _1: match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
match
nth (ancestor dsu (length dsu) x) dsu
(Ancestor Unit)
with
| ReferTo _ => false
| Ancestor _ => true
end
assumption.}Qed.
dsu: list Slot fuel, u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x
ancestorChain dsu fuel u =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
fuel u
dsu: list Slot fuel, u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x
ancestorChain dsu fuel u =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
fuel u
dsu: list Slot fuel, u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end
match nth u dsu (Ancestor Unit) with
| ReferTo _0 => u :: ancestorChain dsu fuel _0
| Ancestor _ => [u]
end =
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
u
:: ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) fuel _0
| Ancestor _ => [u]
end
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: Slot hs: s = nth u dsu (Ancestor Unit) step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) = s
match s with
| ReferTo _0 => u :: ancestorChain dsu fuel _0
| Ancestor _ => [u]
end =
match s with
| ReferTo _0 =>
u
:: ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) fuel _0
| Ancestor _ => [u]
end
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: Slot hs: nth u dsu (Ancestor Unit) = s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) = s
match s with
| ReferTo _0 => u :: ancestorChain dsu fuel _0
| Ancestor _ => [u]
end =
match s with
| ReferTo _0 =>
u
:: ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) fuel _0
| Ancestor _ => [u]
end
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s
u :: ancestorChain dsu fuel s =
u
:: ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
fuel s
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s
u :: ancestorChain dsu fuel s =
u :: ancestorChain dsu fuel s
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s
s < length dsu
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu hd: ∀_0 : nat,
_0 < length (ancestorChain dsu (length dsu) u)
→ nth _0 (ancestorChain dsu (length dsu) u) 0
≠ x step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) g: length dsu ≠ 0 g1: length dsu ≠ 1
1 < length dsu
lia.
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
∃_0 : nat, length dsu = S (S _0)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hS: ∃_0 : nat, length dsu = S (S _0)
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
∃_0 : nat, length dsu = S (S _0)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu
length dsu = S (S (length dsu - 2))
lia.
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hS: ∃_0 : nat, length dsu = S (S _0)
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu v: nat vv: length dsu = S (S v)
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu v: nat vv: length dsu = S (S v)
1 < length (ancestorChain dsu (S (S v)) u)
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu v: nat vv: length dsu = S (S v)
1 <
length
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
u
:: match nth _0 dsu (Ancestor Unit) with
| ReferTo _1 => _0 :: ancestorChain dsu v _1
| Ancestor _ => [_0]
end
| Ancestor _ => [u]
end
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu v: nat vv: length dsu = S (S v)
1 <
length
(u
:: match nth s dsu (Ancestor Unit) with
| ReferTo _0 => s :: ancestorChain dsu v _0
| Ancestor _ => [s]
end)
destruct (nth s dsu (Ancestor Unit)); simpl; lia.
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: nth (nth 0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth 1 (ancestorChain dsu (length dsu) u) 0)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: nth (nth 0 (u :: tail) 0) dsu (Ancestor Unit) =
ReferTo (nth 1 (u :: tail) 0)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: nth u dsu (Ancestor Unit) =
ReferTo (nth 0 tail 0)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: ReferTo s = ReferTo (nth 0 tail 0)
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: ReferTo s = ReferTo (nth 0 tail 0)
s = nth 0 tail 0
→ nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u)
s = nth 0 tail 0
→ nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s
0 < length tail
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s
0 < length tail
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (u :: tail) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s
0 < length tail
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < S (length tail) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s
0 < length tail
lia.
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
validChainToAncestor dsu tail
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail step6: validChainToAncestor dsu tail
nth y (ancestorChain dsu (length dsu) s) 0 ≠ x
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
validChainToAncestor dsu tail
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
tail ≠ []
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
nth 0 tail 0 < length dsu
dsu: list Slot fuel, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end IH: ∀_0 : nat,
_0 < length dsu
→ (∀_1 : nat,
_1 <
length (ancestorChain dsu (length dsu) _0)
→ nth _1
(ancestorChain dsu (length dsu) _0) 0
≠ x)
→ ancestorChain dsu fuel _0 =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) fuel _0 u: nat h3: u < length dsu tail: list nat hd: ∀_0 : nat,
_0 < length (u :: tail)
→ nth _0 (u :: tail) 0 ≠ x hC: ancestorChain dsu (length dsu) u = u :: tail step1: u ≠ x step2: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! u = dsu !! u s: nat hs: nth u dsu (Ancestor Unit) = ReferTo s step3: nth u
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo s y: nat hy: y < length (ancestorChain dsu (length dsu) s) step4: S y < S (length tail) → nth y tail 0 ≠ x a: ancestorChain dsu (length dsu) u ≠ [] b: nth 0 (ancestorChain dsu (length dsu) u) 0 <
length dsu c: ∀_0 : nat,
S _0 < length (ancestorChain dsu (length dsu) u)
→ nth
(nth _0 (ancestorChain dsu (length dsu) u) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) u) 0) hL: 1 < length dsu hA: 1 < length (ancestorChain dsu (length dsu) u) hQ: s = nth 0 tail 0 step5: validChainToAncestor dsu tail
→ tail = ancestorChain dsu (length dsu) s hh: 0 < length tail
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b h: a = x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b h: a ≠ x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b h: a = x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth x
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b h: a = x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: default (Ancestor Unit)
(Some (ReferTo (ancestor dsu (length dsu) x))) =
ReferTo b h: a = x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b h: a = x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b h: a = x
b < length dsu
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b h: a = x
ancestor dsu (length dsu) x = b → b < length dsu
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: ReferTo (ancestor dsu (length dsu) x) = ReferTo b h: a = x d: ancestor dsu (length dsu) x = b
b < length dsu
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a: nat c: ReferTo (ancestor dsu (length dsu) x) =
ReferTo (ancestor dsu (length dsu) x) h: a = x
ancestor dsu (length dsu) x < length dsu
apply ancestorLtLength; assumption.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo b h: a ≠ x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: default (Ancestor Unit) (dsu !! a) = ReferTo b h: a ≠ x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a dsu (Ancestor Unit) = ReferTo b h: a ≠ x
b <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain a, b: nat c: nth a dsu (Ancestor Unit) = ReferTo b h: a ≠ x
b < length dsu
exact (h1 a b c).
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) chain ++ drop t chain) 0 = u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) chain ++ drop t chain) 0 = u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) chain) 0 = u
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) []) 0 = u
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) (head :: tail)) 0 = u
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) []) 0 = u
dsu: list Slot u, x: nat h0: (([] = [] → False)
∧ 1
≤ (fix _0 (_1 : list Slot) : nat :=
match _1 with
| [] => 0
| _ :: _3 => S (_0 _3)
end) dsu
∧ ∀_0 : nat,
S (S _0) ≤ 0
→ (fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) match _0 with
| 0 | _ => 0end dsu
(Ancestor Unit) =
ReferTo 0)
∧ ∃_0 : Tree,
(fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) 0 dsu (Ancestor Unit) =
Ancestor _0 hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) []) 0 = u
easy.
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
nth 0 (take (S i) (head :: tail)) 0 = u
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: head = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < S (length tail) he: match i with
| 0 => head
| S _0 => nth _0 tail 0end = x t: nat hT: match t with
| 0 => head
| S _0 => nth _0 tail 0end = ancestor dsu (length dsu) x hT1: i < t hT2: t < S (length tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(head :: take i tail ++ drop t (head :: tail))
→ ∀_0 : nat,
head = _0
→ head
:: take i tail ++ drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
head = u
dsu: list Slot tail: list nat u, x: nat h0: validChainToAncestor dsu (u :: tail) h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < S (length tail) he: match i with
| 0 => u
| S _0 => nth _0 tail 0end = x t: nat hT: match t with
| 0 => u
| S _0 => nth _0 tail 0end = ancestor dsu (length dsu) x hT1: i < t hT2: t < S (length tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(u :: take i tail ++ drop t (u :: tail))
→ ∀_0 : nat,
u = _0
→ u :: take i tail ++ drop t (u :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
u = u
reflexivity.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(take (S i) chain ++ drop t chain)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u step2: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(take (S i) chain ++ drop t chain)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
take (S i) chain ++ drop t chain ≠ []
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth 0 (take (S i) chain ++ drop t chain) 0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
∀_0 : nat,
S _0 < length (take (S i) chain ++ drop t chain)
→ nth (nth _0 (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo
(nth (S _0) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
∃_0 : Tree,
nth
(nth
(length (take (S i) chain ++ drop t chain) - 1)
(take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor _0
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
take (S i) chain ++ drop t chain ≠ []
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
take (S i) [] ++ drop t [] ≠ []
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
take (S i) (head :: tail) ++ drop t (head :: tail)
≠ []
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
take (S i) [] ++ drop t [] ≠ []
dsu: list Slot u, x: nat h0: (([] = [] → False)
∧ 1
≤ (fix _0 (_1 : list Slot) : nat :=
match _1 with
| [] => 0
| _ :: _3 => S (_0 _3)
end) dsu
∧ ∀_0 : nat,
S (S _0) ≤ 0
→ (fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) match _0 with
| 0 | _ => 0end dsu
(Ancestor Unit) =
ReferTo 0)
∧ ∃_0 : Tree,
(fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) 0 dsu (Ancestor Unit) =
Ancestor _0 hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
take (S i) [] ++ drop t [] ≠ []
easy.
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
take (S i) (head :: tail) ++ drop t (head :: tail)
≠ []
easy.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth 0 (take (S i) chain ++ drop t chain) 0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
nth 0 (take (S i) [] ++ drop t []) 0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
nth 0
(take (S i) (head :: tail) ++ drop t (head :: tail))
0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot u, x: nat h0: validChainToAncestor dsu [] hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
nth 0 (take (S i) [] ++ drop t []) 0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot u, x: nat h0: (([] = [] → False)
∧ 1
≤ (fix _0 (_1 : list Slot) : nat :=
match _1 with
| [] => 0
| _ :: _3 => S (_0 _3)
end) dsu
∧ ∀_0 : nat,
S (S _0) ≤ 0
→ (fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) match _0 with
| 0 | _ => 0end dsu
(Ancestor Unit) =
ReferTo 0)
∧ ∃_0 : Tree,
(fix _1
(_2 : nat) (_3 : list Slot)
(_4 : Slot) {struct _3} : Slot :=
match _2 with
| 0 =>
match _3 with
| [] => _4
| _5 :: _ => _5
end
| S _5 =>
match _3 with
| [] => _4
| _ :: _7 => _1 _5 _7 _4
endend) 0 dsu (Ancestor Unit) =
Ancestor _0 hV: nth 0 [] 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length [] he: nth i [] 0 = x t: nat hT: nth t [] 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length [] h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) [] ++ drop t [])
→ ∀_0 : nat,
nth 0 (take (S i) [] ++ drop t []) 0 = _0
→ take (S i) [] ++ drop t [] =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) [] ++ drop t []) 0 = u
nth 0 (take (S i) [] ++ drop t []) 0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
easy.
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: nth i (head :: tail) 0 = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
nth 0
(take (S i) (head :: tail) ++ drop t (head :: tail))
0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: match i with
| 0 => head
| S _0 => nth _0 tail 0end = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
nth 0
(take (S i) (head :: tail) ++ drop t (head :: tail))
0 <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: match i with
| 0 => head
| S _0 => nth _0 tail 0end = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: nth 0 (head :: tail) 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: match i with
| 0 => head
| S _0 => nth _0 tail 0end = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
head <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot head: nat tail: list nat u, x: nat h0: validChainToAncestor dsu (head :: tail) hV: head = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length (head :: tail) he: match i with
| 0 => head
| S _0 => nth _0 tail 0end = x t: nat hT: nth t (head :: tail) 0 =
ancestor dsu (length dsu) x hT1: i < t hT2: t < length (head :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (head :: tail) ++
drop t (head :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = _0
→ take (S i) (head :: tail) ++
drop t (head :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0
(take (S i) (head :: tail) ++
drop t (head :: tail)) 0 = u
head <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot tail: list nat u, x: nat h0: validChainToAncestor dsu (u :: tail) h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat he: match i with
| 0 => u
| S _0 => nth _0 tail 0end = x hd: i < length (u :: tail) t: nat hT: nth t (u :: tail) 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length (u :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step1: nth 0
(take (S i) (u :: tail) ++
drop t (u :: tail)) 0 = u step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (u :: tail) ++ drop t (u :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (u :: tail) ++
drop t (u :: tail)) 0 = _0
→ take (S i) (u :: tail) ++
drop t (u :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
u <
length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
dsu: list Slot tail: list nat u, x: nat h0: validChainToAncestor dsu (u :: tail) h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat he: match i with
| 0 => u
| S _0 => nth _0 tail 0end = x hd: i < length (u :: tail) t: nat hT: nth t (u :: tail) 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length (u :: tail) h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step1: nth 0
(take (S i) (u :: tail) ++
drop t (u :: tail)) 0 = u step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu)
(take (S i) (u :: tail) ++ drop t (u :: tail))
→ ∀_0 : nat,
nth 0
(take (S i) (u :: tail) ++
drop t (u :: tail)) 0 = _0
→ take (S i) (u :: tail) ++
drop t (u :: tail) =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0
u < length dsu
assumption.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
∀_0 : nat,
S _0 < length (take (S i) chain ++ drop t chain)
→ nth (nth _0 (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
ReferTo
(nth (S _0) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain)
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a = i
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i
nth (nth a (take (S i) chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo (nth (S a) (take (S i) chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ nth i chain 0
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step4: default (Ancestor Unit)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0) =
default (Ancestor Unit) (dsu !! nth a chain 0)
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step4: nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
nth (nth a chain 0) dsu (Ancestor Unit)
nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step4: nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
nth (nth a chain 0) dsu (Ancestor Unit)
nth (nth a chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S a) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a < i _0: x ≠ nth a chain 0
→ <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step2: nth a chain 0 ≠ x step3: <[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu !! nth a chain 0 =
dsu !! nth a chain 0 step4: nth (nth a chain 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (Ancestor Unit) =
nth (nth a chain 0) dsu (Ancestor Unit)
S a < length chain
lia.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: a = i
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth i (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S i) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth i (take (S i) chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S i) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth i (take (S i) chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S i - length (take (S i) chain))
(drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth i (take (S i) chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S i - S i `min` length chain) (drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
nth (nth i (take (S i) chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = ReferTo (nth 0 (drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u b: S i < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l step2: drop t chain !! 0 = chain !! t step3: nth t chain 0 = default 0 (drop t chain !! 0) step4: nth 0 (drop t chain) 0 = nth t chain 0
x < length dsu
lia.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth (nth a (take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a) (take (S i) chain ++ drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth
(nth (a - length (take (S i) chain))
(drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a - length (take (S i) chain))
(drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth
(nth (a - S i `min` length chain) (drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo
(nth (S a - S i `min` length chain) (drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth (nth (a - S i) (drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) =
ReferTo (nth (S a - S i) (drop t chain) 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
default (Ancestor Unit)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu
!! default 0 (drop t chain !! (a - S i))) =
ReferTo (default 0 (drop t chain !! (S a - S i)))
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
default (Ancestor Unit)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu
!! default 0 (chain !! (t + (a - S i)))) =
ReferTo (default 0 (chain !! (t + (S a - S i))))
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
default (Ancestor Unit)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu
!! default 0 (chain !! (t + (a - S i)))) =
ReferTo (default 0 (chain !! S (t + (a - S i))))
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth (nth (t + (a - S i)) chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S (t + (a - S i))) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
x ≠ nth (t + (a - S i)) chain 0
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth (nth (t + (a - S i)) chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S (t + (a - S i))) chain 0)
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
S (t + (a - S i)) < length chain
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < S i + (length chain - t) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
S (t + (a - S i)) < length chain
lia.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
x ≠ nth (t + (a - S i)) chain 0
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
nth i chain 0 ≠ nth (t + (a - S i)) chain 0
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < length (take (S i) chain ++ drop t chain) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
t + (a - S i) < length chain
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u a: nat b: S a < S i + (length chain - t) e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) l: Tree k: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor l hs: i < a
t + (a - S i) < length chain
lia.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
∃_0 : Tree,
nth
(nth
(length (take (S i) chain ++ drop t chain) - 1)
(take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor _0
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
∃_0 : Tree,
nth
(nth
(length (take (S i) chain ++ drop t chain) - 1)
(take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor _0
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth
(nth (length (take (S i) chain ++ drop t chain) - 1)
(take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor b
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth
(nth
(length (take (S i) chain) +
length (drop t chain) - 1)
(take (S i) chain ++ drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor b
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth
(nth
(length (take (S i) chain) +
length (drop t chain) - 1 -
length (take (S i) chain))
(drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor b
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
nth (nth (length (drop t chain) - 1) (drop t chain) 0)
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(Ancestor Unit) = Ancestor b
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u
x ≠ nth (length chain - 1) chain 0
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth (nth (length chain - 1) chain 0) dsu
(Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u gg: x = nth (length chain - 1) chain 0
False
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth x dsu (Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u gg: x = nth (length chain - 1) chain 0
False
dsu: list Slot chain: list nat u, x: nat e: chain ≠ [] f: nth 0 chain 0 < length dsu g: ∀_0 : nat,
S _0 < length chain
→ nth (nth _0 chain 0) dsu (Ancestor Unit) =
ReferTo (nth (S _0) chain 0) b: Tree c: nth x dsu (Ancestor Unit) = Ancestor b hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: false i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u gg: x = nth (length chain - 1) chain 0
False
easy.
dsu: list Slot chain: list nat u, x: nat h0: validChainToAncestor dsu chain hV: nth 0 chain 0 = u h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end i: nat hd: i < length chain he: nth i chain 0 = x t: nat hT: nth t chain 0 = ancestor dsu (length dsu) x hT1: i < t hT2: t < length chain h1': noIllegalIndices
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) step: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
→ ∀_0 : nat,
nth 0 (take (S i) chain ++ drop t chain) 0 =
_0
→ take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)
(length
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu)) _0 step1: nth 0 (take (S i) chain ++ drop t chain) 0 = u step2: validChainToAncestor
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (take (S i) chain ++ drop t chain)
take (S i) chain ++ drop t chain =
ancestorChain
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu)
(length
(<[x:=ReferTo (ancestor dsu (length dsu) x)]> dsu))
u
exact (step step2 u step1).Qed.
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
nth (length chain - 1) chain 0 =
nth (length (drop s chain) - 1) (drop s chain) 0
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
validChainToAncestor dsu (drop s chain)
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
nth 0 (drop s chain) 0 = x
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
nth (length chain - 1) chain 0 =
nth (length (drop s chain) - 1) (drop s chain) 0
dsu: list Slot chain: list nat u, x: nat h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) h3: u < length dsu h4: x < length dsu h5: match nth x dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end h6: validChainToAncestor dsu chain h7: nth 0 chain 0 = u s: nat h8: nth s chain 0 = x h9: s < length chain
reflexivity.Qed.FixpointpathCompress (dsu : list Slot) (fuel : nat) (indexancestor : nat) :=
match fuel with
| O => dsu
| S fuel => match nth index dsu (Ancestor Unit) with
| ReferTo x => pathCompress (<[index := ReferTo ancestor]> dsu) fuel x ancestor
| Ancestor _ => dsu
endend.
dsu: list Slot a, b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e
nth d (pathCompress dsu a b c) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
dsu: list Slot a, b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e
nth d (pathCompress dsu a b c) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e
nth d (pathCompress dsu (S a) b c) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e
nth d
match nth b dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[b:=ReferTo c]> dsu) a _0 c
| Ancestor _ => dsu
end (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: Slot hx: x = nth b dsu (Ancestor Unit)
nth d
match x with
| ReferTo _0 =>
pathCompress (<[b:=ReferTo c]> dsu) a _0 c
| Ancestor _ => dsu
end (Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit)
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b = d
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b = d
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat step: nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[d:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) hx: nth d dsu (Ancestor Unit) = ReferTo x
nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot c, d: nat e: Tree x: nat hd: ReferTo x = Ancestor e step: nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[d:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[d:=ReferTo c]> dsu) (Ancestor Unit) hx: nth d dsu (Ancestor Unit) = ReferTo x
nth d (pathCompress (<[d:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
easy.
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d step2: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
nth d (pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) = nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
nth d dsu (Ancestor Unit)
a: nat IH: ∀ (_0 : list Slot) (_1_2_3 : nat) (_4 : Tree),
nth _3 _0 (Ancestor Unit) = Ancestor _4
→ nth _3 (pathCompress _0 a _1 _2)
(Ancestor Unit) = nth _3 _0 (Ancestor Unit) dsu: list Slot b, c, d: nat e: Tree hd: nth d dsu (Ancestor Unit) = Ancestor e x: nat hx: nth b dsu (Ancestor Unit) = ReferTo x step: nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) =
Ancestor e
→ nth d
(pathCompress (<[b:=ReferTo c]> dsu) a x c)
(Ancestor Unit) =
nth d (<[b:=ReferTo c]> dsu) (Ancestor Unit) hs: b ≠ d
nth c
match nth a dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c
match nth a dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) =
ReferTo b
nth c
match e with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c
match e with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) =
ReferTo b
nth c
match e with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c
match e with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) fuel _0 b
| Ancestor _ => dsu
end (Ancestor Unit) =
ReferTo b
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b hs: c = a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b hs: c ≠ a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b hs: c = a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b: nat hA: a < length dsu hB: b < length dsu hC: a < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth a (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth a dsu (Ancestor Unit)
∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b: nat hA: a < length dsu hB: b < length dsu hC: a < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
∨ nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth a dsu (Ancestor Unit)
∨ nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b: nat hA: a < length dsu hB: b < length dsu hC: a < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
∨ nth a
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
nth a (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
destruct hf; assumption.
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) =
nth c (<[a:=ReferTo b]> dsu) (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b hs: c ≠ a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu hf: nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c
(pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b hs: c ≠ a
nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = nth c dsu (Ancestor Unit)
∨ nth c (pathCompress (<[a:=ReferTo b]> dsu) fuel e b)
(Ancestor Unit) = ReferTo b
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i (<[a:=ReferTo b]> dsu) (Ancestor Unit) =
ReferTo j hs: i ≠ a
j < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a
j < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a
i < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a hi1: i < length dsu
j < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a
i < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a ht: length dsu ≤ i
i < length dsu
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: Ancestor Unit = ReferTo j hs: i ≠ a ht: length dsu ≤ i
i < length dsu
easy.
fuel: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ ∀_1_2_3 : nat,
_1 < length _0
→ _2 < length _0
→ _3 < length _0
→ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
nth _3 _0 (Ancestor Unit)
∨ nth _3 (pathCompress _0 fuel _1 _2)
(Ancestor Unit) =
ReferTo _2 dsu: list Slot h1: noIllegalIndices dsu a, b, c: nat hA: a < length dsu hB: b < length dsu hC: c < length dsu e: nat he: nth a dsu (Ancestor Unit) = ReferTo e hE: e < length dsu i, j: nat hi: nth i dsu (Ancestor Unit) = ReferTo j hs: i ≠ a hi1: i < length dsu
j < length dsu
exact (h1 i _ hi).Qed.
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat
l !! n = l1 !! n
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat
l !! n = l1 !! n
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: option A h1: target1 = l !! n
target1 = l1 !! n
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: option A h1: target1 = l !! n target2: option A h2: target2 = l1 !! n
target1 = target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: option A h1: l !! n = target1 target2: option A h2: target2 = l1 !! n
target1 = target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: option A h1: l !! n = target1 target2: option A h2: l1 !! n = target2
target1 = target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: A h1: l !! n = Some target1 target2: A h2: l1 !! n = Some target2
Some target1 = Some target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: A h1: l !! n = Some target1 target2: A h2: l1 !! n = Some target2 s: n < length l
Some target1 = Some target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: A h1: l !! n = Some target1 target2: A h2: l1 !! n = Some target2 s: n < length l t: nth n l d = nth n l1 d
Some target1 = Some target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: A h1: l !! n = Some target1 target2: A h2: l1 !! n = Some target2 s: n < length l t: default d (Some target1) =
default d (Some target2)
Some target1 = Some target2
A: Type l, l1: list A hL: length l = length l1 d: A hnth: ∀_0 : nat,
_0 < length l → nth _0 l d = nth _0 l1 d n: nat target1: A h1: l !! n = Some target1 target2: A h2: l1 !! n = Some target2 s: n < length l t: target1 = target2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsuScore
(<[u:=ReferTo v]>
(take v dsu ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsuScore
(<[u:=ReferTo v]> (take v dsu) ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsuScore
((take (u `min` v) dsu ++
ReferTo v :: drop (S u) (take v dsu)) ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsuScore
((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
dsuScore
((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
dsuScore
((take u dsu ++ ReferTo v :: drop (S u) (take v dsu)) ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu) =
(dsuScore
(take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
dsuScore
(take u dsu ++
[ReferTo v] ++
drop (S u) (take v dsu) ++
[Ancestor (Unite tree2 tree1)] ++ drop (S v) dsu) =
(dsuScore
(take u dsu ++
[Ancestor tree1] ++
drop (S u) (take v dsu) ++
[Ancestor tree2] ++ drop (v + 1) dsu) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end)
(take u dsu ++
[ReferTo v] ++
drop (S u) (take v dsu) ++
[Ancestor (Unite tree2 tree1)] ++
drop (S v) dsu))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end)
(take u dsu ++
[Ancestor tree1] ++
drop (S u) (take v dsu) ++
[Ancestor tree2] ++ drop (v + 1) dsu))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take u dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo v]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [Ancestor (Unite tree2 tree1)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S v) dsu)))))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (take u dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) [Ancestor tree1]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) [Ancestor tree2]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (v + 1) dsu)))))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take u dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(leafCount tree2 + leafCount tree1 + score tree2 +
score tree1 + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S v) dsu))))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (take u dsu)) +
(score tree1 + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(score tree2 + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (v + 1) dsu)))))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u < v hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: dsu =
take u dsu ++
[nth u dsu (Ancestor Unit)] ++
drop (S u) (take v dsu) ++
[nth v dsu (Ancestor Unit)] ++ drop (v + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take u dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(leafCount tree2 + leafCount tree1 + score tree2 +
score tree1 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S v) dsu))))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (take u dsu)) +
(score tree1 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S u) (take v dsu))) +
(score tree2 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S v) dsu)))))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
lia.Qed.
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsuScore
(<[u:=ReferTo v]>
(take v dsu ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsuScore
(<[u:=ReferTo v]>
(take v dsu ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: Slot b: list Slot
<[u:=a]> b = <[length (take v dsu) + (u - v):=a]> b
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 a: Slot b: list Slot
<[u:=a]> b = <[u:=a]> b
reflexivity.
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsuScore
(<[u:=ReferTo v]>
(take v dsu ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsuScore
(<[length (take v dsu) + (u - v):=
ReferTo v]>
(take v dsu ++
Ancestor (Unite tree2 tree1) :: drop (S v) dsu)) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsuScore
(take v dsu ++
[Ancestor (Unite tree2 tree1)] ++
take (u - v - 1) (drop (S v) dsu) ++
ReferTo v :: drop (S v + S (u - v - 1)) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
dsuScore
(take v dsu ++
[Ancestor (Unite tree2 tree1)] ++
take (u - v - 1) (drop (S v) dsu) ++
[ReferTo v] ++ drop (u + 1) dsu) =
(dsuScore dsu + Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end)
(take v dsu ++
[Ancestor (Unite tree2 tree1)] ++
take (u - v - 1) (drop (S v) dsu) ++
[ReferTo v] ++ drop (u + 1) dsu))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) dsu)) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1 a: dsu =
take v dsu ++
[nth v dsu (Ancestor Unit)] ++
drop (S v) (take u dsu) ++
[nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end)
(take v dsu ++
[Ancestor (Unite tree2 tree1)] ++
take (u - v - 1) (drop (S v) dsu) ++
[ReferTo v] ++ drop (u + 1) dsu))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) dsu)) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1 a: dsu =
take v dsu ++
[nth v dsu (Ancestor Unit)] ++
drop (S v) (take u dsu) ++
[nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end)
(take v dsu ++
[Ancestor (Unite tree2 tree1)] ++
take (u - v - 1) (drop (S v) dsu) ++
[ReferTo v] ++ drop (u + 1) dsu))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end)
(take v dsu ++
[nth v dsu (Ancestor Unit)] ++
drop (S v) (take u dsu) ++
[nth u dsu (Ancestor Unit)] ++
drop (u + 1) dsu))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1 a: dsu =
take v dsu ++
[nth v dsu (Ancestor Unit)] ++
drop (S v) (take u dsu) ++
[nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take v dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [Ancestor (Unite tree2 tree1)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S v) (take u dsu))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo v]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (u + 1) dsu)))))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (take v dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) [Ancestor tree2]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S v) (take u dsu))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) [Ancestor tree1]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (u + 1) dsu)))))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: v < u hL: u < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 h: ∀ (_0 : Slot) (_1 : list Slot),
<[u:=_0]> _1 =
<[length (take v dsu) + (u - v):=_0]> _1 a: dsu =
take v dsu ++
[nth v dsu (Ancestor Unit)] ++
drop (S v) (take u dsu) ++
[nth u dsu (Ancestor Unit)] ++ drop (u + 1) dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take v dsu)) +
(leafCount tree2 + leafCount tree1 + score tree2 +
score tree1 + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S v) (take u dsu))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (u + 1) dsu))))) =
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (take v dsu)) +
(score tree2 + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (S v) (take u dsu))) +
(score tree1 + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0%nat
| Ancestor _1 => score _1
end) (drop (u + 1) dsu)))))) +
Z.of_nat (leafCount tree1) +
Z.of_nat (leafCount tree2))%Z
lia.Qed.
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 hs: u < v
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 hs: v < u
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 hs: u < v
dsu: list Slot tree1, tree2: Tree u, v: nat hUV: u ≠ v hLt1: u < length dsu hLt2, hL: v < length dsu hU: nth u dsu (Ancestor Unit) = Ancestor tree1 hV: nth v dsu (Ancestor Unit) = Ancestor tree2 hs: v < u
apply performMergeScore''; assumption.Qed.Definitionunite (dsu : list Slot) (ab : nat) :=
if decide (length dsu <= a) then dsu elseif decide (length dsu <= b) then dsu elseletu := ancestor dsu (length dsu) a inletdsu1 := pathCompress dsu (length dsu) a u inletv := ancestor dsu1 (length dsu1) b inletdsu2 := pathCompress dsu1 (length dsu1) b v inif decide (u = v) then dsu2 elsematch nth u dsu2 (Ancestor Unit) with
| ReferTo _ => dsu2
| Ancestor tree1 => match nth v dsu2 (Ancestor Unit) with
| ReferTo _ => dsu2
| Ancestor tree2 =>
if decide (leafCount tree2 < leafCount tree1) then performMerge dsu2 tree2 tree1 v u else performMerge dsu2 tree1 tree2 u v
endend.FixpointdsuFromInteractions (dsu : list Slot) (interactions : list (nat * nat)) :=
match interactions with
| [] => dsu
| (a, b)::tail => if decide (a < length dsu /\ b < length dsu) then dsuFromInteractions (unite dsu a b) tail else dsuFromInteractions dsu tail
end.
dsu: list Slot n, a, b: nat
length (pathCompress dsu n a b) = length dsu
dsu: list Slot n, a, b: nat
length (pathCompress dsu n a b) = length dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
length (pathCompress _0 n _1 b) = length _0
length (pathCompress dsu (S n) a b) = length dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
length (pathCompress _0 n _1 b) = length _0
length
match nth a dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = length dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
length (pathCompress _0 n _1 b) = length _0 x: nat
length (pathCompress (<[a:=ReferTo b]> dsu) n x b) =
length dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
length (pathCompress _0 n _1 b) = length _0 x: nat
length (<[a:=ReferTo b]> dsu) = length dsu
apply insert_length.Qed.
dsu: list Slot n, a, b: nat
dsuScore (pathCompress dsu n a b) = dsuScore dsu
dsu: list Slot n, a, b: nat
dsuScore (pathCompress dsu n a b) = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0
dsuScore (pathCompress dsu (S n) a b) = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0
dsuScore
match nth a dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: Slot hx: x = nth a dsu (Ancestor Unit)
dsuScore
match x with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: Slot hx: nth a dsu (Ancestor Unit) = x
dsuScore
match x with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x
dsuScore (pathCompress (<[a:=ReferTo b]> dsu) n x b) =
dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x
dsuScore (<[a:=ReferTo b]> dsu) = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
dsuScore (<[a:=ReferTo b]> dsu) = dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
dsuScore (take a dsu ++ ReferTo b :: drop (S a) dsu) =
dsuScore dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end)
(take a dsu ++ ReferTo b :: drop (S a) dsu))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) dsu))
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take a dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S a) dsu)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) dsu))
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) =
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [nth a dsu (Ancestor Unit)])
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu s: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) =
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [nth a dsu (Ancestor Unit)])
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (take a dsu)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (drop (S a) dsu)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) dsu))
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) =
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [nth a dsu (Ancestor Unit)])
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuScore (pathCompress _0 n _1 b) = dsuScore _0 x: nat hx: nth a dsu (Ancestor Unit) = ReferTo x ha: a < length dsu s: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo b]) =
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [nth a dsu (Ancestor Unit)])
a < length dsu
exact ha.Qed.
dsu: list Slot n, a, b: nat
dsuLeafCount (pathCompress dsu n a b) =
dsuLeafCount dsu
dsu: list Slot n, a, b: nat
dsuLeafCount (pathCompress dsu n a b) =
dsuLeafCount dsu
dsu: list Slot a, b: nat
dsuLeafCount (pathCompress dsu 0 a b) =
dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0
dsuLeafCount (pathCompress dsu (S n) a b) =
dsuLeafCount dsu
dsu: list Slot a, b: nat
dsuLeafCount (pathCompress dsu 0 a b) =
dsuLeafCount dsu
easy.
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0
dsuLeafCount (pathCompress dsu (S n) a b) =
dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0
dsuLeafCount
match nth a dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0 x: Slot hX: x = nth a dsu (Ancestor Unit)
dsuLeafCount
match x with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0 x: Slot hX: nth a dsu (Ancestor Unit) = x
dsuLeafCount
match x with
| ReferTo _0 =>
pathCompress (<[a:=ReferTo b]> dsu) n _0 b
| Ancestor _ => dsu
end = dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0 x: nat hX: nth a dsu (Ancestor Unit) = ReferTo x
dsuLeafCount
(pathCompress (<[a:=ReferTo b]> dsu) n x b) =
dsuLeafCount dsu
dsu: list Slot n, a, b: nat IH: ∀ (_0 : list Slot) (_1 : nat),
dsuLeafCount (pathCompress _0 n _1 b) =
dsuLeafCount _0 x: nat hX: nth a dsu (Ancestor Unit) = ReferTo x
∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices (pathCompress _0 n _1 v)
v: nat dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices (pathCompress dsu 0 u v)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices (pathCompress dsu (S n) u v)
v: nat dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices (pathCompress dsu 0 u v)
v: nat dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices dsu
v: nat dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices dsu
exact h1.
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices (pathCompress dsu (S n) u v)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu
noIllegalIndices
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat hi: nth i
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end (Ancestor Unit) = ReferTo j
j <
length
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat e: Slot he: e = nth u dsu (Ancestor Unit) hi: nth i
match e with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end (Ancestor Unit) = ReferTo j
j <
length
match e with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat e: Slot he: nth u dsu (Ancestor Unit) = e hi: nth i
match e with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end (Ancestor Unit) = ReferTo j
j <
length
match e with
| ReferTo _0 =>
pathCompress (<[u:=ReferTo v]> dsu) n _0 v
| Ancestor _ => dsu
end
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j
j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat e: Tree he: nth u dsu (Ancestor Unit) = Ancestor e hi: nth i dsu (Ancestor Unit) = ReferTo j
j < length dsu
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j
j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j
noIllegalIndices (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j h: noIllegalIndices (<[u:=ReferTo v]> dsu)
j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j
noIllegalIndices (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b ha: a = u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b ha: a ≠ u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b ha: a = u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: ReferTo v = ReferTo b ha: a = u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: ReferTo v = ReferTo b ha: a = u
v = b → b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: ReferTo v = ReferTo b ha: a = u d: v = b
b < length (<[u:=ReferTo v]> dsu)
n, b: nat c: ReferTo b = ReferTo b IH: ∀_0 : list Slot,
b < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 b) dsu: list Slot hV: b < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo b]> dsu) n e b)
(Ancestor Unit) = ReferTo j a: nat ha: a = u
b < length (<[u:=ReferTo b]> dsu)
n, b: nat c: ReferTo b = ReferTo b IH: ∀_0 : list Slot,
b < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 b) dsu: list Slot hV: b < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo b]> dsu) n e b)
(Ancestor Unit) = ReferTo j a: nat ha: a = u
b < length dsu
exact hV.
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b ha: a ≠ u
b < length (<[u:=ReferTo v]> dsu)
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a (<[u:=ReferTo v]> dsu) (Ancestor Unit) =
ReferTo b ha: a ≠ u
b < length dsu
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: default (Ancestor Unit) (dsu !! a) = ReferTo b ha: a ≠ u
b < length dsu
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j a, b: nat c: nth a dsu (Ancestor Unit) = ReferTo b ha: a ≠ u
b < length dsu
exact (h1 _ _ c).
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j, e: nat he: nth u dsu (Ancestor Unit) = ReferTo e hi: nth i (pathCompress (<[u:=ReferTo v]> dsu) n e v)
(Ancestor Unit) = ReferTo j h: noIllegalIndices (<[u:=ReferTo v]> dsu)
j < length (pathCompress (<[u:=ReferTo v]> dsu) n e v)
exact (IH (<[u:=ReferTo v]> dsu) ltac:(rewrite insert_length; exact hV) h e ltac:(rewrite insert_length; exact (h1 _ _ he)) i _ hi).
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat e: Tree he: nth u dsu (Ancestor Unit) = Ancestor e hi: nth i dsu (Ancestor Unit) = ReferTo j
j < length dsu
n, v: nat IH: ∀_0 : list Slot,
v < length _0
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ noIllegalIndices
(pathCompress _0 n _1 v) dsu: list Slot hV: v < length dsu h1: noIllegalIndices dsu u: nat hU: u < length dsu i, j: nat e: Tree he: nth u dsu (Ancestor Unit) = Ancestor e hi: nth i dsu (Ancestor Unit) = ReferTo j _0: j < length dsu
j < length dsu
assumption.Qed.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu
withoutCyclesN
(pathCompress dsu n u (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu
withoutCyclesN
(pathCompress dsu n u (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu u: nat hU: u < length dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
1 < length (ancestorChain dsu (length dsu) u)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
1 < length (ancestorChain dsu (S (S nn)) u)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
1 <
length
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
u
:: match nth _0 dsu (Ancestor Unit) with
| ReferTo _1 => _0 :: ancestorChain dsu nn _1
| Ancestor _ => [_0]
end
| Ancestor _ => [u]
end
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
1 < length (u :: x :: ancestorChain dsu nn s)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: nat hS: nth x dsu (Ancestor Unit) = ReferTo s step2: nth 1 (ancestorChain dsu (length dsu) u) 0 = x
→ 1 <
length (ancestorChain dsu (length dsu) u)
→ ancestor dsu (length dsu) u =
ancestor dsu (length dsu) x ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
1 < S (S (length (ancestorChain dsu nn s)))
lia.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s
2 ≤ length dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s
2 ≤ length dsu
h: withoutCyclesN [] (length []) h1: noIllegalIndices [] n, u: nat hU: u < length [] IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u [] (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor [] (length []) u)]>
[]) (length [])
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor [] (length []) u)]> [])
n x (ancestor [] (length []) x))
(length []) step1: u < length []
→ x < length []
→ ancestor
(<[u:=ReferTo
(ancestor [] (length []) u)]> [])
(length []) x =
ancestor [] (length []) x hX1: x < length [] s: Tree hS: nth x [] (Ancestor Unit) = Ancestor s
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
ancestor dsu (length dsu) u = x
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
ancestor dsu (length dsu) u = x
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
ancestor dsu (S (S nn)) u = x
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
match nth u dsu (Ancestor Unit) with
| ReferTo _0 =>
match nth _0 dsu (Ancestor Unit) with
| ReferTo _1 => ancestor dsu nn _1
| Ancestor _ => _0
end
| Ancestor _ => u
end = x
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn)
x = x
reflexivity.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
withoutCyclesN
(pathCompress
(<[u:=ReferTo (ancestor dsu (length dsu) u)]> dsu)
n x (ancestor dsu (length dsu) u))
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
withoutCyclesN
(pathCompress (<[u:=ReferTo x]> dsu) n x x)
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) n x x =
<[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hh: pathCompress (<[u:=ReferTo x]> dsu) n x x =
<[u:=ReferTo x]> dsu
withoutCyclesN
(pathCompress (<[u:=ReferTo x]> dsu) n x x)
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) n x x =
<[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 0 _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) 0 x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) 0 x x =
<[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) (S _0) x x =
<[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 0 _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) 0 x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) 0 x x =
<[u:=ReferTo x]> dsu
easy.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
pathCompress (<[u:=ReferTo x]> dsu) (S _0) x x =
<[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x
match
nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[u:=ReferTo x]> dsu
end = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u = x
match
nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[u:=ReferTo x]> dsu
end = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
match
nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[u:=ReferTo x]> dsu
end = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u = x
match
nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[u:=ReferTo x]> dsu
end = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, x: nat step1: x < length dsu
→ x < length dsu
→ ancestor
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x step: withoutCyclesN
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) hX: ReferTo x = nth x dsu (Ancestor Unit) hU: x < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) x = x
match
nth x (<[x:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[x:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[x:=ReferTo x]> dsu
end = <[x:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, x: nat step1: x < length dsu
→ x < length dsu
→ ancestor
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x step: withoutCyclesN
(<[x:=ReferTo (ancestor dsu (length dsu) x)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[x:=ReferTo
(ancestor dsu (length dsu) x)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) s: Tree hX: ReferTo x = Ancestor s hU: x < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) hX1: x < length dsu hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) x = x
match
nth x (<[x:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[x:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[x:=ReferTo x]> dsu
end = <[x:=ReferTo x]> dsu
easy.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
match
nth x (<[u:=ReferTo x]> dsu) (Ancestor Unit)
with
| ReferTo _1 =>
pathCompress
(<[x:=ReferTo x]> (<[u:=ReferTo x]> dsu)) _0 _1
x
| Ancestor _ => <[u:=ReferTo x]> dsu
end = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
<[u:=ReferTo x]> dsu = <[u:=ReferTo x]> dsu
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
u ≠ x
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
<[u:=ReferTo x]> dsu = <[u:=ReferTo x]> dsu
reflexivity.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu _0, u: nat hU: u < length dsu IH: ∀_1 : list Slot,
withoutCyclesN _1 (length _1)
→ noIllegalIndices _1
→ ∀_2 : nat,
_2 < length _1
→ withoutCyclesN
(pathCompress _1
(S _0) _2
(ancestor _1 (length _1) _2))
(length _1) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (S _0) x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hd: u ≠ x
u ≠ x
assumption.
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hh: pathCompress (<[u:=ReferTo x]> dsu) n x x =
<[u:=ReferTo x]> dsu
withoutCyclesN
(pathCompress (<[u:=ReferTo x]> dsu) n x x)
(length dsu)
dsu: list Slot h: withoutCyclesN dsu (length dsu) h1: noIllegalIndices dsu n, u: nat hU: u < length dsu IH: ∀_0 : list Slot,
withoutCyclesN _0 (length _0)
→ noIllegalIndices _0
→ ∀_1 : nat,
_1 < length _0
→ withoutCyclesN
(pathCompress _0 n _1
(ancestor _0 (length _0) _1))
(length _0) x: nat hX: ReferTo x = nth u dsu (Ancestor Unit) step: withoutCyclesN
(<[u:=ReferTo (ancestor dsu (length dsu) u)]>
dsu) (length dsu)
→ withoutCyclesN
(pathCompress
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) n x
(ancestor dsu (length dsu) x))
(length dsu) step1: u < length dsu
→ x < length dsu
→ ancestor
(<[u:=ReferTo
(ancestor dsu (length dsu) u)]>
dsu) (length dsu) x =
ancestor dsu (length dsu) x hX1: x < length dsu s: Tree hS: nth x dsu (Ancestor Unit) = Ancestor s ht: 2 ≤ length dsu nn: nat hn: length dsu = S (S nn) hg: ancestor dsu (length dsu) u = x hh: pathCompress (<[u:=ReferTo x]> dsu) n x x =
<[u:=ReferTo x]> dsu
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b
∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0
(S n) _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a
ancestor
(pathCompress dsu (S n) c
(ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a
ancestor
match nth c dsu (Ancestor Unit) with
| ReferTo _0 =>
pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) n _0 (ancestor dsu (length dsu) a)
| Ancestor _ => dsu
end (length dsu) b =
ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: Slot hx: x = nth c dsu (Ancestor Unit)
ancestor
match x with
| ReferTo _0 =>
pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) n _0 (ancestor dsu (length dsu) a)
| Ancestor _ => dsu
end (length dsu) b =
ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x
match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x
match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x
true
easy.
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
(length
(<[c:=ReferTo
(ancestor dsu (length dsu) a)]>
dsu))
→ a <
length
(<[c:=ReferTo
(ancestor dsu (length dsu) a)]>
dsu)
→ b <
length
(<[c:=ReferTo
(ancestor dsu (length dsu) a)]>
dsu)
→ x <
length
(<[c:=ReferTo
(ancestor dsu (length dsu) a)]>
dsu)
→ ancestor
(<[c:=ReferTo
(ancestor dsu
(length dsu) a)]> dsu)
(length
(<[c:=ReferTo
(ancestor dsu
(length dsu) a)]> dsu)) x =
ancestor
(<[c:=ReferTo
(ancestor dsu
(length dsu) a)]> dsu)
(length
(<[c:=ReferTo
(ancestor dsu
(length dsu) a)]> dsu)) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu)
(length
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu)) a))
(length
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu)) b =
ancestor
(<[c:=ReferTo
(ancestor dsu
(length dsu) a)]> dsu)
(length
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu)) b
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(pathCompress dsu 1 c
(ancestor dsu (length dsu) a))
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
match nth c dsu (Ancestor Unit) with
| ReferTo _ =>
<[c:=ReferTo
(ancestor dsu (length dsu) a)]>
dsu
| Ancestor _ => dsu
end
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
(pathCompress dsu 1 c
(ancestor dsu (length dsu) c))
(length dsu)
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
match nth c dsu (Ancestor Unit) with
| ReferTo _ =>
<[c:=ReferTo
(ancestor dsu (length dsu) c)]>
dsu
| Ancestor _ => dsu
end (length dsu)
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu) stepD: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) x
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu) stepD: ancestor dsu (length dsu) a =
ancestor dsu (length dsu) x
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
n, a, b: nat IH: ∀_0 : list Slot,
noIllegalIndices _0
→ withoutCyclesN _0 (length _0)
→ a < length _0
→ b < length _0
→ ∀_1 : nat,
_1 < length _0
→ ancestor _0 (length _0) _1 =
ancestor _0 (length _0) a
→ ancestor
(pathCompress _0 n _1
(ancestor _0 (length _0) a))
(length _0) b =
ancestor _0 (length _0) b dsu: list Slot h1: noIllegalIndices dsu h2: withoutCyclesN dsu (length dsu) hA: a < length dsu hB: b < length dsu c: nat hC: c < length dsu hSameRoot: ancestor dsu (length dsu) c =
ancestor dsu (length dsu) a x: nat hx: nth c dsu (Ancestor Unit) = ReferTo x stepC: match nth c dsu (Ancestor Unit) with
| ReferTo _ => true
| Ancestor _ => false
end stepX: x < length dsu step: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu)
→ withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu)
→ a < length dsu
→ b < length dsu
→ x < length dsu
→ ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
→ ancestor
(pathCompress
(<[c:=
ReferTo
(ancestor dsu
(length dsu) a)]> dsu) n x
(ancestor dsu (length dsu) a))
(length dsu) b =
ancestor dsu (length dsu) b stepN: noIllegalIndices
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) stepW: withoutCyclesN
(<[c:=ReferTo (ancestor dsu (length dsu) a)]>
dsu) (length dsu) stepD: ancestor dsu (length dsu) x =
ancestor dsu (length dsu) a
ancestor
(pathCompress
(<[c:=ReferTo (ancestor dsu (length dsu) a)]> dsu)
n x (ancestor dsu (length dsu) a))
(length dsu) b = ancestor dsu (length dsu) b
apply step; assumption.Qed.DefinitionmodelScore (interactions : list (Z * Z)) := dsuScore (dsuFromInteractions (repeat (Ancestor Unit) 100) (map (fun (x : Z * Z) => let (a, b) := x in (Z.to_nat a, Z.to_nat b)) interactions)).DefinitiongetBalanceInvoke (state : BlockchainState) (communication : list Z) :=
match invokeContract (repeat1%Z 20) (repeat0%Z 20) 0 state state communication 1with
| Some (a, b) => getBalance (b (repeat1%Z 20))
| None => 0%Z
end.
a, b: Z n: nat nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: n ≤ 100 l: list Z hL: length l = 100
a, b: Z n: nat nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: n ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
a, b: Z nextCommands: Action
(WithLocalVariables arrayIndex0
(arrayType arrayIndex0
environment0)
varsfuncdef_0__main)
withLocalVariablesReturnValue () h: 0 ≤ 100 l: list Z hL: length l = 100
match
x as _0
return
(list (arrayType arrayIndex0 environment0 _0))
with
| arraydef_0__dsu =>
<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l
| arraydef_0__hasBeenInitialized => [1%Z]
| arraydef_0__result => [0%Z]
end =
match decide (x = arraydef_0__dsu) with
| left _0 =>
eq_rect_r
(λ_1 : arrayIndex0,
list (arrayType arrayIndex0 environment0 _1))
(<[Z.to_nat (100 - Z.of_nat n - 1):=255%Z]> l)
_0
| right _ =>
match
x as _1
return
(list (arrayType arrayIndex0 environment0 _1))
with
| arraydef_0__dsu => l
| arraydef_0__hasBeenInitialized => [1%Z]
| arraydef_0__result => [0%Z]
endend
(λ_0 : varsfuncdef_0__ancestor,
if decide (_0 = vardef_0__ancestor_work)
then Z.of_nat g
elsematch _0 with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => a
end) =
λ_0 : varsfuncdef_0__ancestor,
match _0 with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => Z.of_nat g
end
∀_0 : varsfuncdef_0__ancestor,
(if decide (_0 = vardef_0__ancestor_work)
then Z.of_nat g
elsematch _0 with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => a
end) =
match _0 with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => Z.of_nat g
end
(if decide (aa = vardef_0__ancestor_work)
then Z.of_nat g
elsematch aa with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => a
end) =
match aa with
| vardef_0__ancestor_vertex => whatever2
| vardef_0__ancestor_work => Z.of_nat g
end
lia.Qed.Fixpointroll (dsu : list Slot) : option Tree :=
match dsu with
| [] => None
| Ancestor x :: rest =>
match roll rest with
| None => Some x
| Some y => Some (Unite x y)
end
| ReferTo x :: rest => roll rest
end.
dsu: list Slot
Z.to_nat (dsuScore dsu)
≤ score (default Unit (roll dsu))
dsu: list Slot
Z.to_nat (dsuScore dsu)
≤ score (default Unit (roll dsu))
Z.to_nat (dsuScore [])
≤ score (default Unit (roll []))
head: Slot tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
x: nat tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (roll (ReferTo x :: tail)))
x: Tree tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [Ancestor x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (roll (Ancestor x :: tail)))
x: nat tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (roll (ReferTo x :: tail)))
x: nat tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (roll tail))
x: nat tail: list Slot IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)))
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (roll tail))
x: nat tail: list Slot IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (roll tail))
exact IH.
x: Tree tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) [Ancestor x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (roll (Ancestor x :: tail)))
x: Tree tail: list Slot IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (roll tail))
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score
(default Unit
match roll tail with
| Some _0 => Some (Unite x _0)
| None => Some x
end)
x: Tree tail: list Slot g: option Tree hg: g = roll tail IH: Z.to_nat (dsuScore tail) ≤ score (default Unit g)
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score
(default Unit
match g with
| Some _0 => Some (Unite x _0)
| None => Some x
end)
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (Some g))
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (Some (Unite x g)))
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuScore tail)
≤ score (default Unit None)
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (Some x))
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuScore tail)
≤ score (default Unit (Some g))
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ score (default Unit (Some (Unite x g)))
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuScore tail) ≤ score g
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ leafCount x + leafCount g + score x + score g
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail))) ≤
score g
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ leafCount x + leafCount g + score x + score g
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score g
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail)
≤ leafCount x + leafCount g + score x + score g
lia.
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuScore tail)
≤ score (default Unit None)
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (Some x))
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuScore tail)
≤ score (default Unit None)
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score (default Unit (Some x))
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuScore tail) ≤ 0
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score x
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail))) ≤ 0
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score x
x: Tree tail: list Slot hg: None = roll tail IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ 0
score x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) tail) ≤ score x
lia.}Qed.
dsu: list Slot
Z.to_nat (dsuLeafCount dsu) =
match roll dsu with
| Some _0 => leafCount _0
| None => 0end
dsu: list Slot
Z.to_nat (dsuLeafCount dsu) =
match roll dsu with
| Some _0 => leafCount _0
| None => 0end
Z.to_nat (dsuLeafCount []) =
match roll [] with
| Some _0 => leafCount _0
| None => 0end
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
Z.to_nat (dsuLeafCount (head :: tail)) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
Z.to_nat (dsuLeafCount []) =
match roll [] with
| Some _0 => leafCount _0
| None => 0end
easy.
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
Z.to_nat (dsuLeafCount (head :: tail)) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (head :: tail)))) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (head :: tail)) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) ([head] ++ tail)) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
head: Slot tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [head]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll (head :: tail) with
| Some _0 => leafCount _0
| None => 0end
x: nat tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
x: Tree tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
matchmatch roll tail with
| Some _0 => Some (Unite x _0)
| None => Some x
endwith
| Some _0 => leafCount _0
| None => 0end
x: nat tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
x: nat tail: list Slot IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail))) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
x: nat tail: list Slot IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
exact IH.
x: Tree tail: list Slot IH: Z.to_nat (dsuLeafCount tail) =
match roll tail with
| Some _0 => leafCount _0
| None => 0end
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
matchmatch roll tail with
| Some _0 => Some (Unite x _0)
| None => Some x
endwith
| Some _0 => leafCount _0
| None => 0end
x: Tree tail: list Slot g: option Tree hg: g = roll tail IH: Z.to_nat (dsuLeafCount tail) =
match g with
| Some _0 => leafCount _0
| None => 0end
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) =
matchmatch g with
| Some _0 => Some (Unite x _0)
| None => Some x
endwith
| Some _0 => leafCount _0
| None => 0end
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuLeafCount tail) = leafCount g
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount (Unite x g)
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuLeafCount tail) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuLeafCount tail) = leafCount g
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount (Unite x g)
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat (dsuLeafCount tail) = leafCount g
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x + leafCount g
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail))) =
leafCount g
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x + leafCount g
x: Tree tail: list Slot g: Tree hg: Some g = roll tail IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount g
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x + leafCount g
lia.
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuLeafCount tail) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuLeafCount tail) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat (dsuLeafCount tail) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
x: Tree tail: list Slot hg: None = roll tail IH: Z.to_nat
(Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail))) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
x: Tree tail: list Slot hg: None = roll tail IH: list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = 0
leafCount x + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) tail) = leafCount x
lia.}Qed.
dsu: list Slot h: roll dsu = None
dsuScore dsu = 0%Z
dsu: list Slot h: roll dsu = None
dsuScore dsu = 0%Z
h: roll [] = None
dsuScore [] = 0%Z
head: Slot tail: list Slot h: roll (head :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (head :: tail) = 0%Z
h: roll [] = None
dsuScore [] = 0%Z
easy.
head: Slot tail: list Slot h: roll (head :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (head :: tail) = 0%Z
g: nat tail: list Slot h: roll (ReferTo g :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (ReferTo g :: tail) = 0%Z
_0: Tree tail: list Slot h: roll (Ancestor _0 :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (Ancestor _0 :: tail) = 0%Z
g: nat tail: list Slot h: roll (ReferTo g :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (ReferTo g :: tail) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (ReferTo g :: tail) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuScore tail = 0%Z
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => score _1
end) (ReferTo g :: tail))) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuScore tail = 0%Z
_0: Tree tail: list Slot h: roll (Ancestor _0 :: tail) = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (Ancestor _0 :: tail) = 0%Z
_0: Tree tail: list Slot h: match roll tail with
| Some _1 => Some (Unite _0 _1)
| None => Some _0
end = None IH: roll tail = None → dsuScore tail = 0%Z
dsuScore (Ancestor _0 :: tail) = 0%Z
destruct (roll tail); easy.Qed.
dsu: list Slot h: roll dsu = None
dsuLeafCount dsu = 0%Z
dsu: list Slot h: roll dsu = None
dsuLeafCount dsu = 0%Z
h: roll [] = None
dsuLeafCount [] = 0%Z
head: Slot tail: list Slot h: roll (head :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (head :: tail) = 0%Z
h: roll [] = None
dsuLeafCount [] = 0%Z
easy.
head: Slot tail: list Slot h: roll (head :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (head :: tail) = 0%Z
g: nat tail: list Slot h: roll (ReferTo g :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (ReferTo g :: tail) = 0%Z
_0: Tree tail: list Slot h: roll (Ancestor _0 :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (Ancestor _0 :: tail) = 0%Z
g: nat tail: list Slot h: roll (ReferTo g :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (ReferTo g :: tail) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (ReferTo g :: tail) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuLeafCount tail = 0%Z
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (ReferTo g :: tail))) = 0%Z
g: nat tail: list Slot h: roll tail = None IH: roll tail = None → dsuLeafCount tail = 0%Z
_0: Tree tail: list Slot h: roll (Ancestor _0 :: tail) = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsuLeafCount (Ancestor _0 :: tail) = 0%Z
_0: Tree tail: list Slot h: match roll tail with
| Some _1 => Some (Unite _0 _1)
| None => Some _0
end = None IH: roll tail = None → dsuLeafCount tail = 0%Z
dsu: list Slot g: Tree hg: roll dsu = Some g a1: Z.to_nat (dsuScore dsu)
≤ score (default Unit (roll dsu)) a2: leafCount
(constructTree
(match roll dsu with
| Some _0 => leafCount _0
| None => 0end - 1)) =
leafCount (default Unit (roll dsu))
→ score (default Unit (roll dsu))
≤ score
(constructTree
(match roll dsu with
| Some _0 => leafCount _0
| None => 0end - 1))
Z.to_nat (dsuScore dsu)
≤ score
(constructTree
(match roll dsu with
| Some _0 => leafCount _0
| None => 0end - 1))
dsu: list Slot g: Tree hg: roll dsu = Some g a1: Z.to_nat (dsuScore dsu)
≤ score (default Unit (Some g)) a2: leafCount (constructTree (leafCount g - 1)) =
leafCount (default Unit (Some g))
→ score (default Unit (Some g))
≤ score (constructTree (leafCount g - 1))
Z.to_nat (dsuScore dsu)
≤ score (constructTree (leafCount g - 1))
dsu: list Slot g: Tree hg: roll dsu = Some g a1: Z.to_nat (dsuScore dsu) ≤ score g a2: leafCount (constructTree (leafCount g - 1)) =
leafCount g
→ score g
≤ score (constructTree (leafCount g - 1))
Z.to_nat (dsuScore dsu)
≤ score (constructTree (leafCount g - 1))
dsu: list Slot g: Tree hg: roll dsu = Some g a1: Z.to_nat (dsuScore dsu) ≤ score g a2: leafCount (constructTree (leafCount g - 1)) =
leafCount g
→ score g
≤ score (constructTree (leafCount g - 1)) _0: 1 ≤ leafCount g
Z.to_nat (dsuScore dsu)
≤ score (constructTree (leafCount g - 1))
dsu: list Slot g: Tree hg: roll dsu = Some g a1: Z.to_nat (dsuScore dsu) ≤ score g a2: leafCount (constructTree (leafCount g - 1)) =
leafCount g
→ score g
≤ score (constructTree (leafCount g - 1)) _0: 1 ≤ leafCount g _1: score g ≤ score (constructTree (leafCount g - 1))
Z.to_nat (dsuScore dsu)
≤ score (constructTree (leafCount g - 1))
length
(if decide (length dsu ≤ a)
then dsu
elseif decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a (ancestor dsu (...) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (...) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (...) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b)
endend) = length dsu
dsu: list Slot a, b: nat h1: length dsu ≤ a
length dsu = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a
length
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = length dsu
dsu: list Slot a, b: nat h1: length dsu ≤ a
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a
length
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: length dsu ≤ b
length dsu = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
length
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: length dsu ≤ b
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
length
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
length
match
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
length
match
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree
length
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
if decide (leafCount _0 < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
_0 m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m _0 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
end = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree
length
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
if decide (leafCount _0 < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
_0 m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m _0 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
end = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree n: nat
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree
length
(if decide (leafCount n < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
n m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree n: nat
length
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree n: nat
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree
length
(if decide (leafCount n < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
n m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: leafCount n < leafCount m
length
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) n
m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)) = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: ¬ leafCount n < leafCount m
length
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) m
n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: leafCount n < leafCount m
length
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) n
m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)) = length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: leafCount n < leafCount m
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: leafCount n < leafCount m
length dsu = length dsu
reflexivity.
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: ¬ leafCount n < leafCount m
length
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) m
n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
length dsu
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: ¬ leafCount n < leafCount m
dsu: list Slot a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m, n: Tree h4: ¬ leafCount n < leafCount m
length dsu = length dsu
reflexivity.Qed.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat
dsuLeafCount (unite dsu a b) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat
dsuLeafCount (unite dsu a b) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat
dsuLeafCount
(if decide (length dsu ≤ a)
then dsu
elseif decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a (ancestor dsu (...) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (...) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (...) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b)
endend) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: length dsu ≤ a
dsuLeafCount dsu = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a
dsuLeafCount
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: length dsu ≤ a
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a
dsuLeafCount
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: length dsu ≤ b
dsuLeafCount dsu = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
dsuLeafCount
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: length dsu ≤ b
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
dsuLeafCount
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
dsuLeafCount
match
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
dsuLeafCount
match
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b ya: Slot yb: ya =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
match ya with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat yb: ReferTo m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
if decide (leafCount _0 < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
_0 m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m _0 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
end = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat yb: ReferTo m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: nat yb: ReferTo m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
if decide (leafCount _0 < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
_0 m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m _0 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
end = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) za: Slot zb: za =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
match za with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
if decide (leafCount _0 < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
_0 m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m _0 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
end = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: nat zb: ReferTo n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(if decide (leafCount n < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
n m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: nat zb: ReferTo n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: nat zb: ReferTo n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
dsuLeafCount
(if decide (leafCount n < leafCount m)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
n m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
m n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: leafCount n < leafCount m
dsuLeafCount
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) n
m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
dsuLeafCount
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) m
n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: leafCount n < leafCount m
dsuLeafCount
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) n
m
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(ancestor dsu (length dsu) a)) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: leafCount n < leafCount m
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
dsuLeafCount
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b:=
ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b:=
ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
ancestor dsu (length dsu) a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
noIllegalIndices dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
noIllegalIndices dsu
exact hN.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m
a < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b:=
ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
y < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
y < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b <
length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b <
length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
noIllegalIndices dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
noIllegalIndices dsu
assumption.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
a < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
x < length dsu
exact xL.}
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu
b < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[y:=ReferTo x]>
(<[x:=Ancestor (Unite m n)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y))) =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(take y (<[x:=Ancestor (Unite m n)]> f) ++
ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
((take x f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - length [Ancestor (Unite m n)])
(drop (S x) f)) ++ ReferTo x :: drop (S y) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
((take x f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take (y - x) [Ancestor (Unite m n)] =
[Ancestor (Unite m n)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsuLeafCount
((take x f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take (y - x) [Ancestor (Unite m n)] =
[Ancestor (Unite m n)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take (S (y - x - 1)) [Ancestor (Unite m n)] =
[Ancestor (Unite m n)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
Ancestor (Unite m n) :: take (y - x - 1) [] =
[Ancestor (Unite m n)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
[Ancestor (Unite m n)] = [Ancestor (Unite m n)]
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsuLeafCount
((take x f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x :: drop (S y) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsuLeafCount
((take x f ++
[Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
[ReferTo x] ++ drop (S y) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
dsuLeafCount
((take x f ++
[Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
[ReferTo x] ++ drop (S y) f) =
dsuLeafCount
(take x f ++
[nth x f (Ancestor Unit)] ++
drop (S x) (take y f) ++
[nth y f (Ancestor Unit)] ++ drop (y + 1) f)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
((take x f ++
[Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
[ReferTo x] ++ drop (S y) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
(take x f ++
[nth x f (Ancestor Unit)] ++
drop (S x) (take y f) ++
[nth y f (Ancestor Unit)] ++ drop (y + 1) f)))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor m]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor n]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (y - x) [Ancestor (Unite m n)] = [Ancestor (Unite m n)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(<[y:=ReferTo x]> (<[x:=Ancestor (Unite m n)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(take y (<[x:=Ancestor (Unite m n)]> f) ++
ReferTo x
:: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
((take y f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - length [Ancestor (Unite m n)])
(drop (S x) f)) ++
ReferTo x
:: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
((take y f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x
:: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take (y - x) [Ancestor (Unite m n)] = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount
((take y f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x
:: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take (y - x) [Ancestor (Unite m n)] = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take 0 [Ancestor (Unite m n)] = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
[] = []
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount
((take y f ++
take (y - x) [Ancestor (Unite m n)] ++
take (y - x - 1) (drop (S x) f)) ++
ReferTo x
:: <[x - S y:=Ancestor (Unite m n)]> (drop (S y) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount
((take y f ++ drop (S x) (take (S x) f)) ++
ReferTo x
:: drop (S y) (take x f) ++
Ancestor (Unite m n) :: drop (S x) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount
((take y f ++ drop (S x) (take (S x) f)) ++
[ReferTo x] ++
drop (S y) (take x f) ++
[Ancestor (Unite m n)] ++ drop (S x) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
dsuLeafCount
((take y f ++ drop (S x) (take (S x) f)) ++
[ReferTo x] ++
drop (S y) (take x f) ++
[Ancestor (Unite m n)] ++ drop (S x) f) =
dsuLeafCount
(take y f ++
[nth y f (Ancestor Unit)] ++
drop (S y) (take x f) ++
[nth x f (Ancestor Unit)] ++ drop (x + 1) f)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
((take y f ++ drop (S x) (take (S x) f)) ++
[ReferTo x] ++
drop (S y) (take x f) ++
[Ancestor (Unite m n)] ++ drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
(take y f ++
[nth y f (Ancestor Unit)] ++
drop (S y) (take x f) ++
[nth x f (Ancestor Unit)] ++ drop (x + 1) f)))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo x]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite m n)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor n]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor m]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
length (drop (S x) (take (S x) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
length (drop (S x) (take (S x) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = []
S x `min` length f - S x = 0
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take (S x) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) []) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (y - x) [Ancestor (Unite m n)] = [] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
dsuLeafCount
(performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) m
n (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)) =
dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b h3: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b m: Tree yb: Ancestor m =
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
dsuLeafCount
(<[x:=ReferTo
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b)]>
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[x:=ReferTo
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b)]>
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
ancestor dsu (length dsu) a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
noIllegalIndices dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
noIllegalIndices dsu
exact hN.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m
a < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a h3: x
≠ ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) n: Tree zb: Ancestor n =
nth
(ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b)
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b))
(Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[x:=ReferTo
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x)) b)]>
(<[ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b
(ancestor
(pathCompress dsu (length dsu) a x)
(length
(pathCompress dsu (length dsu) a x))
b)))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
y < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
y < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b <
length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b <
length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
noIllegalIndices (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
noIllegalIndices dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
noIllegalIndices dsu
assumption.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
a < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
a < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
x < length dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
x < length dsu
exact xL.}
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
b < length (pathCompress dsu (length dsu) a x)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu
b < length dsu
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu
dsuLeafCount dsu = dsuLeafCount dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y))) = dsuLeafCount dsu
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu lp: dsuLeafCount dsu =
dsuLeafCount
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsuLeafCount
(<[x:=ReferTo y]>
(<[y:=Ancestor (Unite n m)]>
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y))) =
dsuLeafCount
(pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f
length dsu = length dsu
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
(take x (<[y:=Ancestor (Unite n m)]> f) ++
ReferTo y
:: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
((take x f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - length [Ancestor (Unite n m)])
(drop (S y) f)) ++
ReferTo y
:: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
dsuLeafCount
((take x f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y
:: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take (x - y) [Ancestor (Unite n m)] = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount
((take x f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y
:: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take (x - y) [Ancestor (Unite n m)] = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y
take 0 [Ancestor (Unite n m)] = []
easy.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount
((take x f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y
:: <[y - S x:=Ancestor (Unite n m)]> (drop (S x) f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount
((take x f ++ drop (S y) (take (S y) f)) ++
ReferTo y
:: drop (S x) (take y f) ++
Ancestor (Unite n m) :: drop (S y) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount
((take x f ++ drop (S y) (take (S y) f)) ++
[ReferTo y] ++
drop (S x) (take y f) ++
[Ancestor (Unite n m)] ++ drop (S y) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
dsuLeafCount
((take x f ++ drop (S y) (take (S y) f)) ++
[ReferTo y] ++
drop (S x) (take y f) ++
[Ancestor (Unite n m)] ++ drop (S y) f) =
dsuLeafCount
(take x f ++
[nth x f (Ancestor Unit)] ++
drop (S x) (take y f) ++
[nth y f (Ancestor Unit)] ++ drop (y + 1) f)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
((take x f ++ drop (S y) (take (S y) f)) ++
[ReferTo y] ++
drop (S x) (take y f) ++
[Ancestor (Unite n m)] ++ drop (S y) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
(take x f ++
[nth x f (Ancestor Unit)] ++
drop (S x) (take y f) ++
[nth y f (Ancestor Unit)] ++ drop (y + 1) f)))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f)))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor m]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor n]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (y + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
drop (S y) (take (S y) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] ms: drop (S y) (take (S y) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
drop (S y) (take (S y) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
length (drop (S y) (take (S y) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] mt: length (drop (S y) (take (S y) f)) = 0
drop (S y) (take (S y) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
length (drop (S y) (take (S y) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = []
S y `min` length f - S y = 0
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] mt: length (drop (S y) (take (S y) f)) = 0
drop (S y) (take (S y) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] ms: drop (S y) (take (S y) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take (S y) f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] ms: drop (S y) (take (S y) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) []) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: x < y stp: take (x - y) [Ancestor (Unite n m)] = [] ms: drop (S y) (take (S y) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take x f)) +
(leafCount m + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) (take y f))) +
(leafCount n + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) f))))))
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(<[x:=ReferTo y]> (<[y:=Ancestor (Unite n m)]> f)) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
(take x (<[y:=Ancestor (Unite n m)]> f) ++
ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
((take y f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - length [Ancestor (Unite n m)])
(drop (S y) f)) ++ ReferTo y :: drop (S x) f) =
dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
dsuLeafCount
((take y f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take (x - y) [Ancestor (Unite n m)] =
[Ancestor (Unite n m)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount
((take y f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take (x - y) [Ancestor (Unite n m)] =
[Ancestor (Unite n m)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
take (S (x - y - 1)) [Ancestor (Unite n m)] =
[Ancestor (Unite n m)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
Ancestor (Unite n m) :: take (x - y - 1) [] =
[Ancestor (Unite n m)]
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x
[Ancestor (Unite n m)] = [Ancestor (Unite n m)]
reflexivity.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount
((take y f ++
take (x - y) [Ancestor (Unite n m)] ++
take (x - y - 1) (drop (S y) f)) ++
ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount
((take y f ++
[Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++
ReferTo y :: drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount
((take y f ++
[Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++
[ReferTo y] ++ drop (S x) f) = dsuLeafCount f
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
dsuLeafCount
((take y f ++
[Ancestor (Unite n m)] ++ drop (S y) (take x f)) ++
[ReferTo y] ++ drop (S x) f) =
dsuLeafCount
(take y f ++
[nth y f (Ancestor Unit)] ++
drop (S y) (take x f) ++
[nth x f (Ancestor Unit)] ++ drop (x + 1) f)
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
((take y f ++
[Ancestor (Unite n m)] ++
drop (S y) (take x f)) ++
[ReferTo y] ++ drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end)
(take y f ++
[nth y f (Ancestor Unit)] ++
drop (S y) (take x f) ++
[nth x f (Ancestor Unit)] ++ drop (x + 1) f)))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x))
b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree yb: Ancestor m =
nth x
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) n: Tree zb: Ancestor n =
nth y
(pathCompress
(pathCompress dsu (length dsu) a x)
(length dsu) b y) (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu f: list Slot hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth y f (Ancestor Unit)]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [nth x f (Ancestor Unit)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor (Unite n m)]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [ReferTo y]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f)))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor n]) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) [Ancestor m]) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (x + 1) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
length (drop (S x) (take (S x) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)] mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
length (drop (S x) (take (S x) f)) = 0
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)]
S x `min` length f - S x = 0
lia.
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)] mt: length (drop (S x) (take (S x) f)) = 0
drop (S x) (take (S x) f) = []
exact (nil_length_inv _ mt).
dsu: list Slot hN: noIllegalIndices dsu a, b: nat h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b x: nat hx: x = ancestor dsu (length dsu) a y: nat hy: y =
ancestor (pathCompress dsu (length dsu) a x)
(length (pathCompress dsu (length dsu) a x)) b h3: x ≠ y m: Tree f: list Slot yb: Ancestor m = nth x f (Ancestor Unit) n: Tree zb: Ancestor n = nth y f (Ancestor Unit) h4: ¬ leafCount n < leafCount m xL: x < length dsu yL: y < length dsu hf: f =
pathCompress (pathCompress dsu (length dsu) a x)
(length dsu) b y lp: dsuLeafCount dsu = dsuLeafCount f cr: length dsu = length f jj: y < x stp: take (x - y) [Ancestor (Unite n m)] = [Ancestor (Unite n m)] ms: drop (S x) (take (S x) f) = []
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f)))) +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))) =
Z.of_nat
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (take y f)) +
(leafCount n + 0 +
(list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S y) (take x f))) +
(leafCount m + 0 +
list_sum
(map
(λ_0 : Slot,
match _0 with
| ReferTo _ => 0
| Ancestor _1 => leafCount _1
end) (drop (S x) f))))))
lia.Qed.
dsu: list Slot a, b: nat h: noIllegalIndices dsu
noIllegalIndices (unite dsu a b)
dsu: list Slot a, b: nat h: noIllegalIndices dsu
noIllegalIndices (unite dsu a b)
dsu: list Slot a, b: nat h: noIllegalIndices dsu
noIllegalIndices
(if decide (length dsu ≤ a)
then dsu
elseif decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu
(length dsu) a))) b))
_1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu
(length dsu) a))) b))
_0 _1 (ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: length dsu ≤ a
noIllegalIndices dsu
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a
noIllegalIndices
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: length dsu ≤ a
noIllegalIndices dsu
exact h.
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a
noIllegalIndices
(if decide (length dsu ≤ b)
then dsu
elseif
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: length dsu ≤ b
noIllegalIndices dsu
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
noIllegalIndices
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: length dsu ≤ b
noIllegalIndices dsu
exact h.
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
noIllegalIndices
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
noIllegalIndices
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b gameover: noIllegalIndices
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a)))
b))
noIllegalIndices
(if
decide
(ancestor dsu (length dsu) a =
ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
then
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
elsematch
nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
| Ancestor _0 =>
match
nth
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)) (Ancestor Unit)
with
| ReferTo _ =>
pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
| Ancestor _1 =>
if decide (leafCount _1 < leafCount _0)
then
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _1 _0
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b) (ancestor dsu (length dsu) a)
else
performMerge
(pathCompress
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu)
a
(ancestor dsu (length dsu)
a))) b)) _0 _1
(ancestor dsu (length dsu) a)
(ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a)))
b)
endend)
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
noIllegalIndices
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
noIllegalIndices
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length dsu) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b
dsu: list Slot a, b: nat h: noIllegalIndices dsu h1: ¬ length dsu ≤ a h2: ¬ length dsu ≤ b gameover: noIllegalIndices
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a)))
b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a)))
b)) heq: ancestor dsu (length dsu) a
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b A: Tree hA: nth (ancestor dsu (length dsu) a)
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) = Ancestor A B: Tree hB: nth
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b)
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) = Ancestor B h3: ¬ leafCount B < leafCount A g, j: nat i: nth g
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
(Ancestor Unit) = ReferTo j hs: g ≠ ancestor dsu (length dsu) a ht: g
≠ ancestor
(pathCompress dsu (length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
j <
length
(pathCompress
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b
(ancestor
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))
(length
(pathCompress dsu
(length dsu) a
(ancestor dsu (length dsu) a))) b))
exact (gameover _ _ i).Qed.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4
withoutCyclesN (performMerge dsu t1 t2 a b)
(length dsu)
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4
withoutCyclesN (performMerge dsu t1 t2 a b)
(length dsu)
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr ww: yy ≠ a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth a
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit) (Some (ReferTo b)) =
ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) =
ReferTo rr ww: yy = a
a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit) (Some (ReferTo b)) =
ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: ReferTo b = ReferTo rr ww: yy = a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: ReferTo b = ReferTo rr ww: yy = a
b = rr → rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: ReferTo b = ReferTo rr ww: yy = a als: b = rr
rr < length dsu
dsu: list Slot a: nat ha: a < length dsu rr: nat hh: ReferTo rr = ReferTo rr hD: a ≠ rr hb: rr < length dsu t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth rr dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy: nat ww: yy = a
rr < length dsu
dsu: list Slot a: nat ha: a < length dsu rr: nat hh: ReferTo rr = ReferTo rr hD: a ≠ rr hb: rr < length dsu t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth rr dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy: nat ww: yy = a _0: ancestor dsu (length dsu) i < length dsu
rr < length dsu
lia.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) =
ReferTo rr ww: yy = a
a < length (<[b:=Ancestor (Unite t2 t1)]> dsu)
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! a) =
ReferTo rr ww: yy = a
a < length dsu
lia.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu))
(Ancestor Unit) = ReferTo rr ww: yy ≠ a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) =
ReferTo rr ww: yy ≠ a
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) =
ReferTo rr ww: yy ≠ a ii: yy = b
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) =
ReferTo rr ww: yy ≠ a ii: yy ≠ b
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) =
ReferTo rr ww: yy ≠ a ii: yy = b
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! b) =
ReferTo rr
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(Some (Ancestor (Unite t2 t1))) = ReferTo rr
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[b:=Ancestor (Unite t2 t1)]> dsu !! b) =
ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(Some (Ancestor (Unite t2 t1))) = ReferTo rr
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: Ancestor (Unite t2 t1) = ReferTo rr
rr < length dsu
easy.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[b:=Ancestor (Unite t2 t1)]> dsu !! b) =
ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(Some (Ancestor (Unite t2 t1))) = ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[b:=Ancestor (Unite t2 t1)]> dsu !! b) =
ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(Some (Ancestor (Unite t2 t1))) = ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: Ancestor (Unite t2 t1) = ReferTo rr
b < length dsu
easy.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[b:=Ancestor (Unite t2 t1)]> dsu !! b) =
ReferTo rr
b < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu rr: nat ww: b ≠ a hh: default (Ancestor Unit)
(<[b:=Ancestor (Unite t2 t1)]> dsu !! b) =
ReferTo rr
b < length dsu
lia.}
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: default (Ancestor Unit)
(<[a:=ReferTo b]>
(<[b:=Ancestor (Unite t2 t1)]> dsu) !! yy) =
ReferTo rr ww: yy ≠ a ii: yy ≠ b
rr < length dsu
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu yy, rr: nat hh: nth yy dsu (Ancestor Unit) = ReferTo rr ww: yy ≠ a ii: yy ≠ b
rr < length dsu
exact (h _ _ hh).
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu))
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ length dsu hs: ancestor dsu (length dsu) i ≠ a ht: ancestor dsu (length dsu) i = b g1: ancestorChain dsu (length dsu) i ≠ [] g2: nth 0 (ancestorChain dsu (length dsu) i) 0 <
length dsu g3: ∀_0 : nat,
S _0 <
length (ancestorChain dsu (length dsu) i)
→ nth
(nth _0 (ancestorChain dsu (length dsu) i)
0) dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) i) 0)
ancestorChain dsu (length dsu) i ≠ []
dsu: list Slot a, b: nat ha: a < 0 hb: b < 0 hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu 0 t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < 0 als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ 0 hs: ancestor dsu 0 i ≠ a ht: ancestor dsu 0 i = b g1: ancestorChain dsu 0 i ≠ [] g2: nth 0 (ancestorChain dsu 0 i) 0 < 0 g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu 0 i)
→ nth (nth _0 (ancestorChain dsu 0 i) 0) dsu
(Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu 0 i) 0)
ancestorChain dsu 0 i ≠ []
dsu: list Slot a, b, g: nat ha: a < S g hb: b < S g hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (S g) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < S g als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ S g hs: ancestor dsu (S g) i ≠ a ht: ancestor dsu (S g) i = b g1: ancestorChain dsu (S g) i ≠ [] g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu (S g) i)
→ nth (nth _0 (ancestorChain dsu (S g) i) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu (S g) i) 0)
ancestorChain dsu (S g) i ≠ []
dsu: list Slot a, b: nat ha: a < 0 hb: b < 0 hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu 0 t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < 0 als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ 0 hs: ancestor dsu 0 i ≠ a ht: ancestor dsu 0 i = b g1: ancestorChain dsu 0 i ≠ [] g2: nth 0 (ancestorChain dsu 0 i) 0 < 0 g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu 0 i)
→ nth (nth _0 (ancestorChain dsu 0 i) 0) dsu
(Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu 0 i) 0)
ancestorChain dsu 0 i ≠ []
dsu: list Slot a, b: nat ha: a < 0 hb: b < 0 hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu 0 t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < 0 als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ 0 hs: ancestor dsu 0 i ≠ a ht: ancestor dsu 0 i = b g1: ancestorChain dsu 0 i ≠ [] g2: nth 0 (ancestorChain dsu 0 i) 0 < 0 g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu 0 i)
→ nth (nth _0 (ancestorChain dsu 0 i) 0) dsu
(Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu 0 i) 0)
[i] ≠ []
easy.
dsu: list Slot a, b, g: nat ha: a < S g hb: b < S g hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (S g) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < S g als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ S g hs: ancestor dsu (S g) i ≠ a ht: ancestor dsu (S g) i = b g1: ancestorChain dsu (S g) i ≠ [] g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu (S g) i)
→ nth (nth _0 (ancestorChain dsu (S g) i) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu (S g) i) 0)
ancestorChain dsu (S g) i ≠ []
dsu: list Slot a, b, g: nat ha: a < S g hb: b < S g hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (S g) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < S g als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ S g hs: ancestor dsu (S g) i ≠ a ht: ancestor dsu (S g) i = b g1: ancestorChain dsu (S g) i ≠ [] g2: nth 0 (ancestorChain dsu (S g) i) 0 < S g g3: ∀_0 : nat,
S _0 < length (ancestorChain dsu (S g) i)
→ nth (nth _0 (ancestorChain dsu (S g) i) 0)
dsu (Ancestor Unit) =
ReferTo
(nth (S _0) (ancestorChain dsu (S g) i) 0)
match nth i dsu (Ancestor Unit) with
| ReferTo _0 => i :: ancestorChain dsu g _0
| Ancestor _ => [i]
end ≠ []
destruct (nth i dsu (Ancestor Unit)) as [jk | jk]; easy.
dsu: list Slot a, b: nat ha: a < length dsu hb: b < length dsu hD: a ≠ b t1, t2: Tree h: noIllegalIndices dsu h1: withoutCyclesN dsu (length dsu) t3: Tree h3: nth a dsu (Ancestor Unit) = Ancestor t3 t4: Tree h4: nth b dsu (Ancestor Unit) = Ancestor t4 i: nat j: i < length dsu als: noIllegalIndices (<[a:=ReferTo b]> (<[b:=Ancestor (Unite t2 t1)]> dsu)) hL: 2 ≤ length dsu hs: ancestor dsu (length dsu) i ≠ a ht: ancestor dsu (length dsu) i = b g1: ancestorChain dsu (length dsu) i ≠ [] g2: nth 0 (ancestorChain dsu (length dsu) i) 0 <
length dsu g3: ∀_0 : nat,
S _0 <
length (ancestorChain dsu (length dsu) i)
→ nth
(nth _0 (ancestorChain dsu (length dsu) i)
0) dsu (Ancestor Unit) =
ReferTo
(nth (S _0)
(ancestorChain dsu (length dsu) i) 0)